Forum Moderators: coopster

Message Too Old, No Replies

Pushing large files for download problem

         

MaXyM

12:29 pm on Jan 18, 2005 (gmt 0)



Hello.
I'm new here. Unfortunately Search said me nothing so I would to refer you my problem.

I store files into MySQL db as binary (mediumblob). Files have size about 2 MB. I'm pushing these out using header sequention:

header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: public");
header("Content-Description: File Transfer");

//Use the switch-generated Content-Type
header("Content-Type: " . $db->Fields['FileMime']);

//Force the download
print header("Content-Disposition: attachment;
filename=" . $filename.zip');
header("Content-Transfer-Encoding: binary");
// header("Content-Length: " . strlen($db->Fields['FileContent']));

echo $db->Fields['FileContent'];

Simmilar code works good for small files, Ie pictures which I show at pages.

But in that case, with large files sometimes download slow down and stall finally. With sending COntent-Lenght is the same but problem occures for other users (in other networks).

Actualy I don't know is that problem of http server, some proxies or something else. But there must be some way to solve this problem

Thank you for any help.
Best Regards

coopster

2:12 am on Jan 19, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, MaXyM.

Tough one, no doubt. I guess first things you may want to check might be some of your configuration directives ( [php.net...] ) and also remember to check your logs for any indicators.