15
ดาวน์โหลดและเปิดไฟล์ PDF โดยใช้ Ajax
ฉันมีคลาสแอคชั่นที่สร้าง PDF contentTypeตั้งที่เหมาะสม public class MyAction extends ActionSupport { public String execute() { ... ... File report = signedPdfExporter.generateReport(xyzData, props); inputStream = new FileInputStream(report); contentDisposition = "attachment=\"" + report.getName() + "\""; contentType = "application/pdf"; return SUCCESS; } } ฉันเรียกสิ่งนี้action ผ่านการโทร Ajax ฉันไม่รู้วิธีส่งสตรีมนี้ไปยังเบราว์เซอร์ ฉันลองทำสองสามอย่าง แต่ไม่ได้ผล $.ajax({ type: "POST", url: url, data: …
101
javascript
java
jquery
pdf