Forum Moderators: coopster
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 :(