Application header problem -> PHP

software development


Hello every body!

I need help about the headers we have to use with dreamhost. In fact, i retrieve (with streams or cURL) the content of whole file, and i would like the web browser to let me download this content by using specific headers. These are the ones i use on my machin with a xampp apache server :

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: application/octet-stream”);
header(“Content-Disposition: attachment; filename=”.basename($sourceFTP).";");
header(“Content-Transfer-Encoding: binary”);
header("Content-Length: ".filesize($sourceFTP));

I have to say that personnaly i don’t really understand it because i’m not very good at headers technology.
The only thing i know is that it perfectly works on my xampp, but not on dreamhost. The download is initialized, but it stays in the “starting” mode on firefox, and is cancelled by internet explorer after the “save as…” part.

Can someone tell me why please?

Thanks a lot



I found that it was the “filesize” header that cause the problem. Without it, it works…

But do you know why the “filesize” header is not accepted by dreamhost ?


Has nothing to do with Dreamhost. Headers are accepted by the browser, server has nothing to do with it.

If anything, your file size value is incorrect and the browser isn’t liking it.

yerba# rm -rf /etc