Robert Posted July 4, 2003 Posted July 4, 2003 Hi, for a Web-Application i need to display pdf-files in a browser using Response.Clear() Response.ClearHeaders() Response.ContentType = "application/pdf" Response.BinaryWrite(DokData) or Response.WriteFile(FilePath) Response.End() the File is displayed but when I want to save the file from the browser to the lokal disk in the save-dialog the filename is not correct. Instead it's the name of the aspx-page with the pdf-extension (e.g. myASPXPage.pdf). It's found that it's possible to force a download by adding Response.AppendHeader("Content-Disposition", "attachment; filename=myPDFFile.pdf") but i need to display the file... How can i get the correct filename into the save-dialog? Thank's for your help! Quote
Martin Posted July 4, 2003 Posted July 4, 2003 I have a clumsy solution that will work ;) 1.) Have a primary script that copies your PDF output script to a new file with the correct PDF name. 2.) Re-direct to the PDF output page. Example: InBetween.aspx Copies and Renames PDF.aspx To ThisPDFDocument Therefore download reads: ThisPDFDocument.pdf Its not clean, but it would work - good luck :P Quote
Moderators Robby Posted July 4, 2003 Moderators Posted July 4, 2003 why does Response.AppendHeader not work for you? Quote Visit...Bassic Software
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.