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 ??
Reg file downloading
Moderator: General Moderators
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.
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 ??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.
Try adding binary transfer encoding and file size:
Code: Select all
header("e;Content-Transfer-Encoding: binary"e;);
header("e;Content-Length: "e;.filesize("e;paper.pdf"e;));