Link to home
Start Free TrialLog in
Avatar of cycledude
cycledudeFlag for United Kingdom of Great Britain and Northern Ireland

asked on

PHP upload files of up to 50MB

Hi

I have hosting on a shared windows server.

I want to be able to let my clients upload large (ish) files to my server for me to work on...

I am unable to access the php.ini file to change the max file size settings so I am looking for an alternative that will allow me to upload files in the region of 50MB...

Anyone know of a workaround for this problem? FREE solution would be good!

Thanks

CD
ASKER CERTIFIED SOLUTION
Avatar of crazedsanity
crazedsanity
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cycledude

ASKER

Hi crazedsanity
Thanks for the feedback...  How do I find out (without asking the host) if it is running apache?
Cheers
 
 
Create a PHP file and put "phpinfo()" in it.  That will output pretty much everything you need to know (and probably a lot more): it should have lots of references to "apache" or "apache2".
Hi again
I already tried that and it doesn't mention apache...  oh dear!
 
From what I've found with PHP running on Windows without Apache, it seems there may be little choice.  The only way I could potentially help you any further would be to give me a link to the info page or save it & attach as a file.  Sorry.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
@progressed
Thats a nice upload utlilty, however it crashes at the same point as a normal file upload, due to the server not allowing over xMB
@crazedinsanity
See attached phpinfo

test.php.htm
It looks like the server is setup to use FastCGI on IIS 6.0.  You can attempt to put your own php.ini file in your "wwwroot" directory to see if that will override the default, but it looks like the server won't allow it (the "wwwroot" folder isn't in the path).

There is some good information about your setup here: http://www.php.net/manual/en/install.windows.iis6.php
Avatar of Progressed
Progressed

Dont change default settings of your php.ini! its not set by default for nothing!

make a new file or add the following line to your .htaccess file:

php_value memory_limit 60M

This wel set the uploadlimit of ONLY this website to 60M.
offcourse i ment:

php_value upload_max_filesize 60M
php_value max_execution_time 1000

while your at it... the executiontime must be longer then default... duhh!
@progressed
I already tried adding a .htaccess file with the following
php_value upload_max_filesize 100M
php_value max_execution_time 800
php_value post_max_size 100M
php_value max_input_time 100
php_value memory_limit 120M
 
but it did not work...
well it should...
@Progressed: the ".htaccess" solution is only applicable when the server is Apache.  This server is running PHP in FastCGI form on IIS/6.0.

@cycledude: did you try copying the php.ini to your public (wwwroot) folder and setting the values there?  HINT: after changing values, make sure to reload the page with the phpinfo() in it, see what INI file/values are there.
@crazedsanity
I don't know where to locat the php.info file, I have never seen it?
 
 
sorry i mean php.ini
 
I just asked my host the same question and the response was:
"Not on Windows hosting I'm afraid.

It's a global php.ini"

Doh!
 

 
 
Unfortunately, it seems that you may not have any options here.  The host has all the control here, so you may have to somehow get them to update your upload_max_filesize setting, which probably has to be done in your website's configuration.
Hi... Thanks for all the help
I guess it a 'change host' situation... although I would be grieved to do so as they have have been great...
I could use something like this, which allows you to upload massive files without any server side configuration
http://www.aspupload.com/
Is there a php alternative to this?
I could use ASP, it would not be a problem....
Oh yeah, if there was a 'free' alternative it would be great!
 
welllll... lookie here! did the fileuploading stop around 30Mb?

Heres why!

to the MediaWiki LocalSettings.php configuration file for each wiki. In this example the PHP limit is set at 50 Mb. Note that these settings will not override the maximum settings set above (since the core php.ini and apache2 php.ini files set the absolute maximum). This method sets maximums that are less than the absolute maximum.

 Note: IIS7 Users. By default, IIS7 on Windows 2008 allows only 30MB to be uploaded via a web application. Larger files will return a 404 error after the upload. If you have this problem, you can solve it by increasing the maximum file size by adding the following code to <system.webServer> in the web.config file:

<security>
  <requestFiltering>
    <requestLimits maxAllowedContentLength=”50000000¿ />
  </requestFiltering>
</security>
With the above maxAllowedContentLength, users can upload files that are 50,000,000 bytes (50 MB) in size. This setting will work immediately without restarting IIS services. The web.config file is located in the root directory of your web site.
@progressed
Hi Mate, the server I am on is iis6 and I am using php, although asp could be used, indeed even asp.net ....
But what you are referring to I believe is related to iis7, which I don't have access to.
Thanks for looking though.
 
Hello fellas

Well it looks like I have come full circle on this, and it looks like I am not going to be able to achieve the upload of large files without buying a 3rd part com object.

Thanks for the advice, I have awarded points to both experts but 80% goes to crazedsanity as he offered most advice.

Thanks

CD
too bad... well glad to be of assistance anyway!

Danny