Reputation: 303
I use below code to generate download link for my filesm but the generated download links aren't resumable. Also, they aren't showing file size while downloading:
//set_time_limit(0);
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
header("Content-Type: application/download");
header("Content-Disposition: filename=file.zip");
$ch = curl_init("http://dl.otherserver.com/file.zip");
curl_exec($ch);
curl_close($ch);
exit();
How can I solve this problem?
Upvotes: 1
Views: 364
Reputation: 2707
Because the client doesn't know about the filesize yet. You need to send the Content-Length
header.
header('Content-Length: ' . filesize($myFile));
Don't know much about resuming file uploads though.
Upvotes: 1