php - readfile not working properly -
By downloading streaming, I am trying to download a file through my server.
This is my script:
header ('content-description: file transfer'); Header ('content-type: application / octet-stream'); Header ('content-dispute: attachment; file name = http: // user: pass@example.com/file.bin'; header ('content-transfer-encoding: binary'); header ('expiration: 0' Header ('Pragma: Public'); Header ('Content-Length:'. $ R [2]; Header ('Cache-Control: Re-Modify, Post-Check = 0, Pre-Check = 0'); Header ]; Ob_clean (); flush (); readfile ($ fileName); exit;
is not actually what I'm actually using, I really do not want to be real Wanted url. :) when i A download prompt goes to this file in my web browser and nothing happens. $ r [2]
The file's bytes have content length and the same URL used in the $ fileName
attachment header. I do not really know what I'm doing.
readfile (); Instead of Url, the full path of the file is required on the machine.
For example, /home/person/file.exe
Comments
Post a Comment