Best of all, prevent the browser from opening the document in the first place. Instead offer users the choice to save the file on their hard disk or to open it in its native application (Adobe Reader for PDF, PowerPoint for slides, etc.). Unfortunately, doing so requires a bit of technical trickery: you have to add an extra HTTP header to the transmission of the offending file. The header line to be added is "Content-disposition: Attachment". If possible, also add "; filename=somefile.pdf" at the end of this line, to give the browser an explicit filename if the user chooses to save the file.
http://www.useit.com/alertbox/open_new_windows.html
Tony
No comments:
Post a Comment