Hi all,
I have created a download manger to handle files, when a user clicks a link
the file is sent though fopen() and fpassthru()
like this:

header("Content-type: application/octet-stream");
header("Content-disposition: attachment; filename=" . $file['filename']);
header("Content-transfer-encoding: binary");
header("Content-length: " . filesize($file['path'] . $file['filename']));

// get file contents
$file = @fopen($file['path'] . $file['filename'], 'r');

// output
fpassthru($file);
exit;

is this the most practical way of doing it? i don't want to display file
location.. the script seems to be working okay, but i was just looking for
opinions on the method. also, is it possible to insert a txt file on the fly
if the file they're downloading is a ZIP file? if so, any ideas how?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to