I want to download file from my server using php. I searched google and found a stackoverflow answer here. This answer shows that I have to write these codes for this purpose.
$file_url = 'http://www.myremoteserver.com/file.exe';
header('Content-Type: application/octet-stream');
header("Content-Transfer-Encoding: Binary");
header("Content-disposition: attachment; filename=\"" . basename($file_url) . "\"");
readfile($file_url);
But I am able to do this with merely these two lines:
header("content-disposition:attachment; filename=uploads1/EFL1.5_Setup.exe");
readfile("uploads1/EFL1.5_Setup.exe");
So why I should write a few more lines like codes above?