开发者

Save a PDF that's been streamed to the browser

开发者 https://www.devze.com 2022-12-31 13:44 出处:网络
I\'m streaming PDFs to the browser, and it works fine. The problem is when someone clicks the save button.On the same server, we have a \"Live\" and a \"test\" site.They are identical, and I\'ve verif

I'm streaming PDFs to the browser, and it works fine. The problem is when someone clicks the save button. On the same server, we have a "Live" and a "test" site. They are identical, and I've verified that all code is identical. However I'm seeing different dialog boxes when the user clicks "Save"

Test site: - dialog box: "Save A Copy"

- file name: "Document.pdf"

- file type: Adobe PDF

Live site: - dialog box: "Save As..."

- file name: "Document.aspx"

- file type: Adob开发者_如何学Goe PDF

To make things even more "fun" I've noticed this behavior ONLY with IE8. With Firefox or Chrome clicking save - regardless of which site (test or live) opens the "Save a Copy" dialog box which allows the users to save the file as a PDF instead of a .aspx file.

Any suggestions are appreciated


It might have to do with your IIS mime settings being different between the two servers.

Make sure your HTTP response headers are set properly as well. You'll be able to specify the filename using the content-disposition(?) attachment: filename.pdf (IIRC)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号