Page 1 of 1

Reg file downloading

Posted: Sat Jun 04, 2005 1:55 am
by sumeet
I m facing a probs in allowing file downloads. The probs is i m able to download files of size <= 2Mb but not more than this .. The script i m using is

header("Content-Description: File Transfer");
header("Content-Type: application/force-download");
header("Content-Disposition: attachment; filename=". "paper.pdf");

readfile($link);

where $link is path to file which i wanna download .. I m using apache server in linux .. any suggestions ??

Posted: Sat Jun 04, 2005 2:06 am
by anjanesh
Normally file upload is set to 2 MB in the php.ini file as
upload_max_filesize = 2M

but I dont think there is a premade restriction for downloads unless there is an .htaccess file in that folder that rectricts.

Posted: Sat Jun 04, 2005 2:12 am
by sumeet
anjanesh wrote:Normally file upload is set to 2 MB in the php.ini file as
upload_max_filesize = 2M

but I dont think there is a premade restriction for downloads unless there is an .htaccess file in that folder that rectricts.
The limit to upload in php.ini was raised to 15 MB by me long back .. and i dint made any changes by .htaccess .. any other option ??

Posted: Sat Jun 04, 2005 2:38 am
by Revan
Perhaps Apache is timing out?

Posted: Sat Jun 04, 2005 4:09 am
by anjanesh
Try adding binary transfer encoding and file size:

Code: Select all

header(&quote;Content-Transfer-Encoding: binary&quote;);
header(&quote;Content-Length: &quote;.filesize(&quote;paper.pdf&quote;));