[thelist] Sending File Size headers in PHP
Tony Grimes
info at scribenewmedia.com
Fri Oct 17 17:44:34 CDT 2003
I've got a PHP download script that sends a file to the browser, but while
it's downloading, the browser displays something like "25K of ?". Is there a
way of telling the browser how big the file is?
<code>
if(is_file(/path/to/file.doc)) {
// Tell Browser what type of file we're outputting.
header("Content-type: application/ms-word");
// Give it a name.
header("Content-Disposition: attachment; filename=file.doc");
// Output the file.
readfile(/path/to/file.doc);
}
</code>
Any help would be appreciated.
.tony
More information about the thelist
mailing list