| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
Registered User
Join Date: Mar 2007
Posts: 1
|
Hi everyone, this my first posting. I have a problem. I'm new to web design, just set up my first site. I would like to have visitors be able to click a button to download a .pdf file. The way it's set up right now is as soon as they click the button, the file just opens for them to save if they choose. How do I set the link so that the visitors gets prompted to download the file instead of it just opening up. Any help is appreciated. Thanks. |
|
|
|
|
|
#5 (permalink) |
|
Senior Member
Join Date: Jan 2005
Posts: 12,358
|
I'm sure there's a way to do it in any server-side scripting language. Probably by changing the mime type. Or, you could make it really obnoxious for your users and zip the pdf and have them download the zip and unzip it. Out of curiosity, why do you want to force people to download it? |
|
|
|
#7 (permalink) |
|
389 ppm and rising
Join Date: Aug 2005
Location: Järvenpää, Finland
Posts: 4,877
|
So they have a reminder (= advertisement) on their desktop, of course. I recently transferred all my demos and examples offsite and onto pdfs for precisely that reason. A few people will save the pdfs and see them later and... well, you know how advertsing works - repetition repetition repetition |
|
|
|
#9 (permalink) |
|
Registered User
Join Date: Mar 2007
Location: California
Posts: 19
|
This is a problem with having a pdf reader installed. By default the pdf mime type gets associated with the reader and thus it opens a window to display the document. As someone mentioned earlier, the main way around this is to change the mime type to something like application/octet-stream; but this can also have undesired effects. The whole point of mime types is that different platforms handle content differently and it is not the job of the web developer to dictate to the user how a particular file should be used. Your best bet would be to denote that the link is a pdf, perhaps by simply putting in brackets (link to pdf) and indicating that the user should right-click the link in order to save it to their disk. |
|
![]() |