Sometimes being automatically offered the choice to download or open a .pdf is desired. There are different methods to do this, using Active X, Java, JavaScript and ASP coding. Here are several different ways to publish pdf files on IIS, some of which giving an open/save choice without and scripting.
Method1 - Embed
Use: <EMBED src="/path/to/file" width="600" height="600" type=application/pdf href="/path/to/file"></EMBED> <NOEMBED>Your browser does not support embedded PDF files.</NOEMBED>
note: works in IE6, Firefox 1.5; add "href=" for netscape
Your browser does not support embedded PDF files. Open file by clicking here.
13predictions.pdf (62.89 KB)
download
download-2
<OBJECT CLASSID="clsid:CA8A9780-280D-11CF-A24D-444553540000" WIDTH="600" HEIGHT="600"> <PARAM NAME="SRC" VALUE="path/to/file"> <PARAM NAME="HREF" VALUE="path/to/file"> <EMBED SRC="path/to/file" HEIGHT="500" WIDTH="500" HREF="path/to/file"> <NOEMBED> Your browser does not support embedded PDF files. </NOEMBED> </EMBED> </OBJECT>
Note: Due to a bug in FreeTextBox (DasBlog's native editor) this approach works, briefly, until the post is edited which screws up the EMBED code.
Method6 - iframe
[Your browser does not support iframe, or has been configured not to display inline frames. You can access the document via a link though.]
iframe
Method7 - ftp
A link to the file via an ftp site might open the file in the same window, a new window or offer an open/save dialog depending on the browser
Powered by: newtelligence dasBlog 2.2.8279.16125
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2025, john kelly
E-mail