Reply
How to force a download of pdf?
Old 01-08-2009, 10:53 AM How to force a download of pdf?
magicvw's Avatar
Extreme Talker

Posts: 184
Name: Vicky
Location: Brit in Bulgaria
Not sure if this is in the right section, as I don't know how to begin doing it!

I have several pdfs on my site which I sell using Paypal. I am currently emailing them out on payment, but it's not a very efficient system, so I'm going to use the redirect feature on Paypal to send the buyer to a page with a link to the pdf.

I then want to have a button or link for the buyer to click to download the pdf to their own computer, rather than have the pdf opening up in the browser.

I guess html won't do this? PHP? Javascript? Anybody got a simple script/link where I can copy and paste some simple code?
__________________
My Music Theory

Blog
magicvw is offline
Reply With Quote
View Public Profile Visit magicvw's homepage!
 
When You Register, These Ads Go Away!
Old 01-08-2009, 10:55 AM Re: How to force a download of pdf?
wayfarer07's Avatar
Power Hungry Seamonkey

Posts: 2,630
Name: Abel Mohler
Location: Asheville, North Carolina USA
Put it in a zip file and point to it.
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 01-08-2009, 01:03 PM Re: How to force a download of pdf?
King Spam Talker

Posts: 1,362
If zipped html will work fine.

For security reasons you will need to change the return URL every now and then so people can not share the link with friends.

To comply with PP standards you must have the landing page and can not specify the download link as the return URL. You landing page should contain something like:
You have paid at PayPal and this is your download page.

The actual text is on the PayPal site.
colbyt is online now
Reply With Quote
View Public Profile
 
Old 01-08-2009, 02:23 PM Re: How to force a download of pdf?
AD7863's Avatar
15 Year Old Tech Blogger

Posts: 372
Name: Artful Dodger
Location: England, UK
Yep, just put it in a zip folder and then upload it to your host space. Then just point to it. If somone clicks the link it should download automatically.
__________________
AD7863 is offline
Reply With Quote
View Public Profile Visit AD7863's homepage!
 
Old 01-08-2009, 03:11 PM Re: How to force a download of pdf?
magicvw's Avatar
Extreme Talker

Posts: 184
Name: Vicky
Location: Brit in Bulgaria
Thanks! have done as instructed - just got to sit back and wait for someone to buy now

I've already used a Paypal landing page so I know the orders - but thanks anyway

Is it pretty universal that people have unzipping software? I put a link to WinZip on the page just in case.

Doing a zipped file is nice and simple so I'll probably stick with it, but out of interest, how would it be done without zipping a pdf? I know I have clicked on "download pdf" links before which get sent directly to my firefox downloads. How is that done - ie what kind of code?
__________________
My Music Theory

Blog
magicvw is offline
Reply With Quote
View Public Profile Visit magicvw's homepage!
 
Old 01-08-2009, 03:51 PM Re: How to force a download of pdf?
wayfarer07's Avatar
Power Hungry Seamonkey

Posts: 2,630
Name: Abel Mohler
Location: Asheville, North Carolina USA
Windows will automatically unzip anything (though not zip it), so that is no problem. Don't know about Mac, but I'd be shocked if it didn't.
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 01-08-2009, 05:52 PM Re: How to force a download of pdf?
King Spam Talker

Posts: 1,362
Quote:
Windows will automatically unzip anything
It will handle all zip files. It won't do tar, gz or rar files. For those you need winrar.
colbyt is online now
Reply With Quote
View Public Profile
 
Old 01-09-2009, 06:21 AM Re: How to force a download of pdf?
chrishirst's Avatar
Super Moderator

Posts: 19,022
Location: Blackpool. UK
and only in WinXP and above
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System | Bits & Bobs
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to How to force a download of pdf?
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 



Page generated in 0.14771 seconds with 12 queries