/**
* Get the MIME structure
- *
+ *
* This function gets the structure of a message and stores it in the "message" class.
* It will return this object for use with all relevant header information and
* fully parsed into the standard "message" object format.
* @param string $type1 second half of mime type
* @param string $filename filename to tell the browser for downloaded file
* @param boolean $force whether to force the download dialog to pop
+ * @param integer $filesize optional, send the Content-Header and length to the browser
* @return void
*/
- function SendDownloadHeaders($type0, $type1, $filename, $force) {
+ function SendDownloadHeaders($type0, $type1, $filename, $force, $filesize=0) {
global $languages, $squirrelmail_language;
$isIE = $isIE6 = 0;
header("Content-Type: application/octet-stream; name=\"$filename\"");
}
}
- }
+
+ //send the content-length header if the calling function provides it
+ if ($filesize > 0) {
+ header("Content-Length: $filesize");
+ }
+
+ } // end fn SendDownlaodHeaders
?>