Hey, im creating a force download script and everything works fine its just the file that is downloaded is only ever 0 KB.
Ok let me try and explain first the script gets the file
Then after some error checking and sercurity checkingCode:$file = "download/".strip_tags(trim((string) $_GET['file']));
I use this code
Maybe someone can be of assistance to me.Code:header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Cache-Control: public"); header("Content-Type: application/zip"); header("Content-Disposition: attachment; filename=$file"); header("Content-Transfer-Encoding: binary"); header("Content-Length: ".filesize($file));![]()




Bookmarks