Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#12 file download / filesize

open
Michael Davey
None
5
2005-02-26
2003-03-07
Andre Meyer
No

set the content-length header, so you can see the
expected download time.

below the code for the
tiki-download_wiki_attachment.php, maybe its usefull
elsewhere. all changes marked with GMT.

tiki-download_wiki_attachment.php:
.
.
.

$type=&$info["filetype"];
$file=&$info["filename"];
$filesize=&$info["filesize"]; // GMT
$content=&$info["data"];

//print("File:$file<br/>");
//die;
header("Content-type: $type");
//header( "Content-Disposition: attachment;
filename=$file" );
//header( "Content-Disposition: inline; filename=$file"
); // GMT //

header('Content-Disposition: attachment;
filename="'.$file.'"'); // GMT
header("Content-length: ".(string)($filesize)); // GMT

if($info["path"]) {
readfile($w_use_dir.$info["path"]);
} else {
echo "$content";
}
?>

Discussion

  • Andre Meyer
    Andre Meyer
    2003-03-07

    Logged In: YES
    user_id=720222

    hmmm maybe attaching the file is a better idea ;)

     
  • Andre Meyer
    Andre Meyer
    2003-03-07

    Logged In: YES
    user_id=720222

    grmpf

     
  • Dennis Daniels
    Dennis Daniels
    2003-11-22

    • summary: file download / filesize --> PATCH: file download / filesize
     
    • summary: PATCH: file download / filesize --> file download / filesize
     
  • Michael Davey
    Michael Davey
    2005-02-26

    • assigned_to: nobody --> michael_davey