Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old April 12th, 2007, 09:35 AM
Joey Nolan
Guest
 
Posts: n/a
Default Looking for script to do a "controlled download"

Hi,
I have a PDF file on my site that I want to distribute freely but I want to
be able to contact anyone who downloaded it to warn them about mistakes and
modification and new versions and updates...

So I need some way to keep their email addresses and someway to prevent them
sharing the link to the PDF file.

I've seen some sites
- with a form for the user to fill in
- where the client fills in his email address
- and receives a mail
- containing a unique link to the file to download
- and I think the link has a timeout on it somehow.

Can anyone point me to a script so that I can set up something similar?

TIA

Joey




  #2  
Old April 15th, 2007, 10:25 PM
Henk verhoeven
Guest
 
Posts: n/a
Default Re: Looking for script to do a "controlled download"

Joey,

For controlling the download you need to:
1. make sure the file can only be downloaded through a script
2. add some code to the script to control the dowlnoad.

For the first you need to put the file somewhere where your php script
can read it but the visitors of your website can not. Then how to write
the script you can find in the user comments on:
http://nl2.php.net/manual/en/function.header.php

The last is just a matter of putting a form on you website that visitors
have to fill out. You let the form call the download script. Make the
download script check if the form has been filled out properly. If it
has, you store the info in a database or have it sent to your own email
address, then continue with the download. If not, you print some error
message and let them try again.

"The last" is really very basic php, i assume you can do it, if not,
just look around for some beginners tutorials, there must be thousends
of them out there. The first is a bit tricky, i suggest you first
experiment with the code for reading and printing a file until you can
successfully get a html file displayed through the script, then
experiment with the header stuff until you get it working with pdf as well.

I agree this is more work then a ready made script, but in the end you
will be really in control.

Greetings,

Henk Verhoeven,
www.phpPeanuts.org.

Joey Nolan schreef:
Quote:
Hi,
I have a PDF file on my site that I want to distribute freely but I want to
be able to contact anyone who downloaded it to warn them about mistakes and
modification and new versions and updates...
>
So I need some way to keep their email addresses and someway to prevent them
sharing the link to the PDF file.
>
I've seen some sites
- with a form for the user to fill in
- where the client fills in his email address
- and receives a mail
- containing a unique link to the file to download
- and I think the link has a timeout on it somehow.
>
Can anyone point me to a script so that I can set up something similar?
>
TIA
>
Joey
>
>
>
>
 

Bookmarks

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

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

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles