1
I use this code to force download, it works perfect when I run it on XAMPP, however it returns corrupted file when running on ubuntu, what can I do to fix?
header('Content-Length: ' . filesizecurl($file_path));
header('Content-Type: "application/zip"');
header('Content-Disposition: attachment; filename="'.basename($new_name).'"');
header("Content-Transfer-Encoding: binary");
header('Expires: 0');
header('Pragma: no-cache');
// Envia o arquivo para o cliente
readfile($file_path);