Been trying to get this to work for a while now, and I've read through a bunch of SO posts. But I've tried it all, and it doesnt work..
This is the code I'm trying now:
header("Content-type: application/octet-stream");
header("Content-Length: " . filesize($_REQUEST['file']));
header("Content-Disposition: attachment; filename=".basename($_REQUEST['file']));
readfile($_REQUEST['file']);
But it doesnt work. It works for all my other files, but not .FLV.
It shows size is 190bytes, and it only saves a file that's 190bytes. It does have the correct url, as I can enter the url in my browser and it plays the video.
Any ideas?
I've tried a lot of headers:
header('Pragma: public'); // required
header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename=".basename($_REQUEST['file']));
header("Content-Type: video/mpeg");
header("Content-Transfer-Encoding: binary");
header("Content-Length: " . filesize($_REQUEST['file']));
header('Cache-Control: must-revalidate, post-check=0, pre-check=0', false);
header('Cache-Control: private', false); // required for certain browsers
What I want is a savefile.php file that can save all the different video formats, and also zip, rar, exe and so on files. It would be great if there would be some way of supporting it all, based on the file extension given by the file...
EDIT:
I've even tried using fopen, but nothing works. It shows 190 bytes, but I know for a fact that the url is correct. And the file works (testing this locally on xampp now, so I have easy access to my files)