Hi! I'm a novice and designing my first webpage. I'm hosting with GoDaddy and can't seem to get a function to work. I have uploaded a .pdf file and would like for it to prompt a user to download the .pdf file when landing on the page specified; ie: "website.com/downloads/champion.pdf" and being able to download the file champion.pdf when landing on that page. Any suggestions? Thank you!
You could create a pop-up window with a link to the pdf you want them to download. You will find the code you need here - http://www.javascript-coder.com/window-popup/javascript-window-open.phtml. However, you need to remember that majority of users disable pop-up windows because of the security issues. In fact, forcing your user to download anything automatically may only cause irritation and they will leave as soon as they will see it. If your pdf contains some important information try to display it promptly on a website, encouraging them to download. People don't like being to force to do anything..;-)
Thank you for your response, AHEINC. I was thinking more along the lines of having a link sent to them via email and when they click the link, it automatically will prompt them to download the file that they would like. I've asked around and gotten a couple of responses. Now I've gotten the page to work, but no download is prompted. The title is "Macworld02-11.pdf (application/pdf Object)." I'm familiar with this title, as it's trying to open the file, but it doesn't prompt a download. Is there a command to fix this issue? Thanks again for the tips.
The issue here isn't your file, but your browser. Your browser has the Adobe Reader plugin to automatically open PDF files in your browser. If a user doesn't have this addon, they will be prompted to download the file to their computer. However if this isn't satisfactory and you want to force users to download a file, you can setup a php script to make this happen: http://nspeaks.com/656/force-file-downloads-instead-of-opening/ Not sure if this will work for you, but you can always do a google search for "Force users to download PDF file".