Hello everyone,
I was woundering if PHP "readfile" method consume server bandwidth by the size of the file that is read.
I am asking this because I am creating a download script for large file like this
[PHP]
...
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
header("Content-Type: $type");
header("Content-Disposition: attachment; filename=\"".basename($filename)."\";" );
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".filesize($filename));
readfile("$filename");
....
[/PHP]
with the above code it seem that whenever some one choose to download file with that script, the bandwidth get consumed by the file size automaticly even if I tryied to cancel it after few kilobytes, it consume the whole file size
am I wrong or not?
and if there is other better way to do it please let me know
what I need is to let the user download AVI files, this code
[PHP]
header('Location: ' . $row['url']);
[/PHP]
works fine with Firefox, it show the save dialog and doesnt consume bandwidth
but when trying it with IE, it automatically save it to the Temporary folder without showing the save dialog (open/save location dialog), and I dont want it to do this
any help will be appreciated
Thanks in advance,