Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Expiring or on-the-fly links.

Expiring or on-the-fly links.
Thread Tools
Trygve
Mac Enthusiast
Join Date: Jul 2000
Location: Dubai, UAE
Status: Offline
Reply With Quote
Nov 20, 2005, 10:08 AM
 
I'd like to setup expirng or on-the-fly links. basically I have some files that I would like to control access to. When someone pays for one, I'd like to send them a link that only they can use. I can do this manually of course by setting up a special folder with username/password for each individual, but how can I do it in a more logical way?

Thanks,

Trygve
     
deuce868
Fresh-Faced Recruit
Join Date: Oct 2005
Status: Offline
Reply With Quote
Nov 21, 2005, 09:01 AM
 
You create a link with extra url parameters like:

http://mysite.com/file.php?username=someone

THen store in the db the username/file and an expiration time. When someone requests the file you would check that it hasn't expired and if so go get it and send it to the user. Otherwise say "No way".

Now the tricks to this are delivering the file to the user with forced downloads and storing your file ourside the web root so that they can't access it without any of the extra url parameters.

I haven't done this before, but it seems something like this should work.
     
Trygve  (op)
Mac Enthusiast
Join Date: Jul 2000
Location: Dubai, UAE
Status: Offline
Reply With Quote
Nov 21, 2005, 09:07 AM
 
I got the ?username=someone part... the trick IS setting it up so the file can't be accessed without the url params. If the php script just redirects to http://mysite.com/files/somefile.sit then once they know the URL, it can be passed around.

I have often seen links like: http://mydomain.com/37fjos834ms934o9fmsj83/somefile.sit and I assume this is some sort of on-the-fly directory creation that can somehow know when the download is done and kill the directory.

Any thoughts?
     
betoranaldi
Junior Member
Join Date: Aug 2003
Status: Offline
Reply With Quote
Nov 21, 2005, 02:30 PM
 
one of the scripts found on the following page might help you out.

http://php.resourceindex.com/Complet...nk_Protection/
     
   
 
Forum Links
Forum 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 On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 10:12 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,