View Single Post
Old 03-08-2010, 06:13 AM   #5 (permalink)
delayedinsanity
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default

Who said anything about META? Village, I think you've been hitting the bottle again.

Write a little function to determine what file is to be sent (and where its located) based on an ID passed to your script, and there's no reason you can't send any number of files from a single location.

Read in some GET that does a lookup (SQL, array, from a file, from where ever) to match the ID to the file, then send your headers and pipe that sucker through.

php Code:
if ( isset( $_GET['id'] ) )
    $file = do_something_to_determine_file( 'dont_forget_to_validate' );
else
    die( 'You missed your turn.' );

header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename=$file");
header("Content-Type: application/zip"); // Change this to match your file type.
header("Content-Transfer-Encoding: binary");

readfile($file);

All files are transferred from a single location never giving up their location to charlie.
delayedinsanity is offline  
Reply With Quote