PHP file downloads bytes missing -


After

I am trying to download a .msi file which is the actual size of 5.77 MB Am When I downloaded the downloaded script, the file will lose some bytes and will become 4.88 MB

Code :.

  $ file = 'apps / file.msi'; Header ('content-description: file transfer'); Header ('content-type: application / octet-stream'); Header ('content-dispute: attachment; filename =' .busname ($ file)); Header ('content-transfer-encoding: binary'); Header ('end: 5'); Header ('Cash-Control: Required-Modified, Post Check = 0, Pre-Check = 0'); Header ('pragma: public'); Header ('content-length:'. File size ($ file)); Ob_clean (); Flush (); Readfile ($ file);  

I also tried anchor tag and with the same happend. I also changed the extension from .txt to .msi and the bytes were also deleted from the downloaded file.

I just can not understand it outside

this

  $ try file = 'apps / file.msi'; Header ('content-type: application / octet-stream'); Header ("content-transfer-encoding: binary"); Header ("Content-Disclosure: Attachment; Filename = \" ". BaseName ($ file)." \ ""); Readfile ($ file);  

Comments

Popular posts from this blog

c# - SignalR: "Protocol error: Unknown transport." when navigating to hub -

class - Kivy: how to instantiate a dynamic classes in python -

python - mayavi mapping a discrete colorbar on a surface -