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
cycledudeAsked:
Who is Participating?
 
crazedsanityCommented:
It is a per-directory configuration, so you should be able to put it in a ".htaccess" file (assuming the server is running Apache), in the form:

php_value upload_max_filesize 50M

For more information, take a look at the PHP page about it, as you will probably also need to look at the directive for post_max_size.  

DIRECTIVES PAGE: http://us.php.net/manual/en/ini.core.php#ini.upload-max-filesize 
CONFIG CHANGES: http://php.net/manual/en/configuration.changes.php

Let me know if you need more information.
0
 
cycledudeAuthor Commented:
Hi crazedsanity
Thanks for the feedback...  How do I find out (without asking the host) if it is running apache?
Cheers
 
 
0
 
crazedsanityCommented:
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".
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
cycledudeAuthor Commented:
Hi again
I already tried that and it doesn't mention apache...  oh dear!
 
0
 
crazedsanityCommented:
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.
0
 
ProgressedCommented:
no worries... just use uploadify! its a flash uploader and its uploads a file on the fly!

Youll get a nice upload status with it!

www.uploadify.com
0
 
cycledudeAuthor Commented:
@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
0
 
crazedsanityCommented:
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
0
 
ProgressedCommented:
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.
0
 
ProgressedCommented:
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!
0
 
cycledudeAuthor Commented:
@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...
0
 
ProgressedCommented:
well it should...
0
 
crazedsanityCommented:
@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.
0
 
cycledudeAuthor Commented:
@crazedsanity
I don't know where to locat the php.info file, I have never seen it?
 
 
0
 
cycledudeAuthor Commented:
sorry i mean php.ini
 
0
 
cycledudeAuthor Commented:
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!
 

 
 
0
 
crazedsanityCommented:
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.
0
 
cycledudeAuthor Commented:
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....
0
 
cycledudeAuthor Commented:
Oh yeah, if there was a 'free' alternative it would be great!
 
0
 
ProgressedCommented:
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.
0
 
cycledudeAuthor Commented:
@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.
 
0
 
cycledudeAuthor Commented:
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
0
 
ProgressedCommented:
too bad... well glad to be of assistance anyway!

Danny
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.