如何在java中创建另存为对话框?
我创建了一个网络应用程序,其中数据报告应转换为 pdf 和 excel,然后存储到特定位置。但我指定了特定内容,以便自动存储。但他们希望我提供一个另存为对话框来选择位置,我很困惑如何添加。我使用jsp作为前端,mysql作为后端pdf转换连接,所有这些都是在servlet中完成的。
i had create a web application in which data report should be converted to pdf and excel then it should stored to a specific location. but i am specifying particular so that i will be stored automatically. But they want me to provide a save as dialog box to choose location i am confused how to add. i am using jsp as frontend mysql as backend pdf conversion connectivity all are done in servlet.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
包含 PDF 二进制流的响应应具有以下标头:
这将告诉浏览器将 PDF 视为附件,并且浏览器将打开“另存为”对话框,其中建议的文件名为 theFileName.pdf。不过,您无法建议目录位置。
The response containing the PDF binary stream should have the following header :
This will tell browsers to treat the PDF as an attachment, and the browser will open a Save As dialog box where the proposed file name is theFileName.pdf. You won't have any possibility to suggest a directory location, though.