Link to home
Start Free TrialLog in
Avatar of hagur
hagur

asked on

PHP & HTTP file upload ... size limit?

Hi ... I've created a video gallery system where users can create a video gallery and upload video files to the galleries.  The problem is that I cannot seem to be able to upload files after they reach a certain size ... I cannot upload 1mb files but I can upload ~400 kb files.
So the limit is somewhere there between.

I'm just using INPUT TYPE=FILE in a form with enctype="multipart/form-data".

The php file which the form submits to simply takes the name of the variable and uses the copy function to copy it to it's destination.

Is this a limit with PHP or the HTTP standard? Or maybe is this a configuration somewhere in the web server?

This has to be possible ....

Avatar of lokeshv
lokeshv

this is what i got from some site

By default PHP limits the file size a user can upload so that a user cannot fill the temp space, to increase the file size limityou need to edit your php.ini (/usr/local/lib) to increase the value  of the following line

upload_max_filesize = 2097152


hope this will help


Lk:)
You've also need to add a hidden-field to the form:

<input type="hidden" name="MAX_FILE_SIZE" value="2000000">

This is the max-file size for uploads in byte.

If your still having problem, you have to check the configuration of your webserver.

Batalf
lokeshv : We were writing at the same time.
Assuming you run apache as your web server; you can set the filesize limit in php.ini AND in httpd.conf.

filesize limits (post_max_size) in php.ini are usually around 4 or 8 MB, so i think the limit is in your web server configuration. However, I don't know how to resolve this with apache.
ASKER CERTIFIED SOLUTION
Avatar of lokeshv
lokeshv

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 hagur

ASKER

Thanks guys, I'll try this out as soon as I can!
Avatar of hagur

ASKER

Thanks!

This seems to have solved my problem.