homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / WebmasterWorld / New To Web Development
Forum Library, Charter, Moderators: brotherhood of lan & mack

New To Web Development Forum

Incorportating PDF's

 5:27 pm on Aug 23, 2005 (gmt 0)

I have 3 PDF files I want to put on the site, when they click on the link I want to ask them if they want to open it or download it.

Please could somebody tell me how to do this.



 8:15 pm on Aug 23, 2005 (gmt 0)

You don't need to do anything besides make a link to the PDF. Files that are handled outside your web browser default to show that prompt you are thinking of... it is a prompt from your browser, not from the code of a webpage. If you're talking about FORCING a user to see that prompt, regardless of whatever download preferences they may have set, that's another thing, but I wouldn't advise messing with people's prefs.


 8:22 pm on Aug 23, 2005 (gmt 0)

You can't force the option to appear; as Don Hoagie notes it is a setting on the client side. One workaround is to provide two links, one to a PDF (which will usually open in a browser window) and another to a ZIP file containing the PDF (which will usually prompt to be saved locally).


 8:39 pm on Aug 23, 2005 (gmt 0)

For many users that isnt the case; if you have a PDF reader installed (say adobe) IE will open the PDF in that program. I have around 40 on one of my sites.


 4:08 pm on Aug 24, 2005 (gmt 0)

Thank you once agian sound advice. Not quite sure what I would do with out the brains from this site.

Thank you


 5:45 pm on Aug 25, 2005 (gmt 0)

You can't force the option to appear

Not exactly correct. . . but nearly so. It is a real pain to work around the default browser behavior (which is to open the file for if the user has the application installed on their machine), but there are some scripts that can be used to do so. There is a way with php, for instance. But certainly not with straight HTML or simple javascript.

So, for most the best way to keep the file from opening is to provide an alternate zip version.

Of course, there IS one other way built into all browsers that doesn't require ANY additional files or code -- simply include a line instructing your users to RIGHT-click on the link and choose "Save Target As. . . " All depends on what you think is reasonable to expect of the users of the particular web site.

Global Options:
 top home search open messages active posts  

Home / Forums Index / WebmasterWorld / New To Web Development
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved