A
Anonymous
Guest
I have a downloader script which runs great with texts documents, but anything else gets corrupted. Can anyone see why?
By the way, I've tried a few different Content-type's specific to the target file's format, application/octet-stream and the one above.
Code:
header("Content-type: application/force-download");
header("Content-Disposition: attachment; filename=".stripslashes($_GET['filename']));
header("Content-length: ".filesize(stripslashes($_GET['dir'].$_GET['filename'])));
readfile(stripslashes($_GET['dir'].$_GET['filename']));
By the way, I've tried a few different Content-type's specific to the target file's format, application/octet-stream and the one above.