Forum Moderators: coopster

Message Too Old, No Replies

PHP Download Script

         

anxie

9:32 am on Feb 5, 2006 (gmt 0)



Hi there I hope someone can help me because I've been looking for other ways to do this but I can't seem to figure it out.

I've been using a readfile() and some headers to force downloads after a user is logged in. It works fine but you can't resume the download if it stops. I was wondering if anyone knew a different way to force downloads.

$dir = directory where file is located
$db_entry = filename in database

$file = $dir . $db_entry;
header("Content-type: application/force-download");
header('Content-disposition: attachment; filename="' . basename($file) . '"');
header("Content-Transfer-Encoding: Binary");
header("Content-length: ".filesize($file));
readfile($file);

this is how I'm doing it currently. Please help :(

jackvull

10:49 am on Feb 6, 2006 (gmt 0)

10+ Year Member



Isn't resuming the download up to the way the user's computer saves the file? Not sure if you be able to do that but someone else might have a way...