Topic: PHP, Session, Temp File (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=30797" title="Pages that link to Topic: PHP, Session, Temp File (Page 1 of 1)" rel="nofollow" >Topic: PHP, Session, Temp File <span class="small">(Page 1 of 1)</span>\

 
Boudga
Maniac (V) Mad Scientist

From: Jacks raging bile duct....
Insane since: Mar 2000

posted posted 01-30-2009 21:29

Hi all,

It's been a long time since I've been around here. I've been off doing this and that in internet marketing. Anyway to get the point I am looking for some ideas on how to proceed with a small project I have on the side. Here it is:


I have a web page with an email submit form on it. When the page is loaded a session is started (php). I want to serve up an mp3 file download prompt upon a successful email submit. I want only the person that filled out the email address to get the link to the temporary mp3 download. I thought about using the session id as a unique identifier in the url of the mp3 download so that I could prevent url link sharing. What I'm not sure about is how to serve up the mp3 for download so that once the session is killed the mp3 becomes unavailable.

Can anyone point me to any sites that have working examples that I could learn from? I've already Googled several things but have not really found a solution yet.

twItch^
Maniac (V) Mad Scientist

From: Denver, CO, USA
Insane since: Aug 2000

posted posted 01-30-2009 21:52

You could store the session id, the mp3 filename, and a timestamp in a database, then run a cron job every 15 minutes or something to remove the ones that expired. That'd be the way I'd go. Also keeps a good running tally of what you've got out there at any given point.

-S

Boudga
Maniac (V) Mad Scientist

From: Jacks raging bile duct....
Insane since: Mar 2000

posted posted 01-30-2009 22:01

where would you store the physical mp3 so that it couldn't be shared/hotlinked?

Arthurio
Paranoid (IV) Inmate

From: cell 3736
Insane since: Jul 2003

posted posted 01-31-2009 02:43

in a non accessible location, served through a php script that checks whether the origin of the request is from the right url(s) ... this can be faked but it's the best you can do short from authentication ... I think ... maybe there's an even easier solution tho ...



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu