PHP File Downloading (limit?)


I have wordpress installed on my site and am using Shopp( for customers to buy my clients products. I noticed that there is a PHP file upload limit of 20megs, I was able to FTP up the files ( 350megs ) to the server, but now when a user buys a product and they are given a download link ( php page, not a direct link to the the zip file) It seems they can only download 20mgs of the zip file and then the browser download says its done. Does anyone know of a setting I can set to allow for bigger files to be served up? and where and how to set this?

Thanks a ton!

Is there any chance that DreamHost doesnt allow you to overwrite the PHP method as to allow max script time?

The download page uses this? which should be no limit, but it seems like 30 secs is what the page is doing from my estimate.


Ask the guys at Shopp what are the settings you need on your php.ini file for this to work properly… then DH has a guide on how to adjust your php settings here:

That might get you going.

They don’t have any requirements but I see in the download code they use the php set_time_limit(0) which doesnt seem to be taking. I tried setting my own php.ini useing the “lazy” way ( but when I made changes to it they don’t seem to take, like when i view the phpinfo or try changing the max php upload size ( a different issue I experienced on this server). I test the Shopp software on a friends server hosted elsewhere and didn’t experience the same issues.

Thanks for any other ideas…

Did you ever get this resolved? I read through their site and they do clearly have requirements posted did you make sure that your host matches all reqs?

No I never got this resolved and Yes and I have ran their wordpress plug-in that checks your hosting. I have tested this functionality on a friends server on a different hosting and did not see the same issues. That’s why i was looking at the php settings. So far my work around of serving up a text file with a link to a zip file so the browser has a link to the zip file to download and can resume if the server times out.

Hi Chaps,

I’m using readfile to force the download of a file:

[code]PHP Code:

$file = ‘monkey.gif’;

if (file_exists($file)) {
header(‘Content-Description: File Transfer’);
header(‘Content-Type: application/octet-stream’);
header(‘Content-Disposition: attachment; filename=’.basename($file));
header(‘Content-Transfer-Encoding: binary’);
header(‘Expires: 0’);
header(‘Cache-Control: must-revalidate, post-check=0, pre-check=0’);
header(‘Pragma: public’);
header('Content-Length: ’ . filesize($file));
flush(); [/code]

And this works fine, however, I do have some software installation files that could be downloaded (these are in excess of 280Mb).
I have checked php.ini:
memory_limit = 128M
post_max_size = 300M
But Internet Explorer hangs and then crashes.
Is there a way to allow big files to download using this method, or is there another way of forcing the download, without php ‘reading’ the file first?
I’m guessing that the problem lies with the memory_limit being smaller than the file size. Is it a good idea to increase the memory_limit to eg. 280Mb?