php - Forced download stopped working -


I have a PHP script that I've used for years to download from my website. But in the last month or so, it stopped working and there was no error in triggering the file. The strange thing is that in Firefox, if I look at the source on the error page, then this is the file I was trying to download. And File> Save from there you get the correct file so I know that there is no problem with this script, which is not looking for the file on the server.

Am I establishing some titles?

  header "Purgama: public"); Header ("End: 0"); Header ("Cash-Control: Required-Modified, Post Check = 0, Pre-Check = 0"); Header ("Cash-Control: Private", Incorrect); Header ('content-type: application / octet-stream'); Header ('Content-Transfer Encoding: Binary'); Header ('content-length:' .make file ($ file_url)); Header ('Content-Disclosure: Attachment; File Name =' '. BaseName ($ file_url).' '' '); Readfile ($ FILE_URL);  

Can you try this function?

function force_loadload ($ file) {header ('content-description: file transfer'); Header ('content-type: application / octet-stream'); Header ('content-dispute: attachment; filename =' .busname ($ file)); Header ('content-transfer-encoding: binary'); Header ('expiration: 0'); Header ('Cash-Control: Required-Modified, Post Check = 0, Pre-Check = 0'); Header ('pragma: public'); Header ('content-length:'. File size ($ file)); Readfile ($ file); Go out; }

Comments