tags:

views:

51

answers:

4

do we have any size issue with the file uploads that we perform in php using $_file[upload][name]? is there any restriction for the file upload using this ??? juz need to know ..

+8  A: 

In your php.ini

; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize = 2M

and (added after suggestions from others below)

; Maximum size of POST data that PHP will accept.
; http://php.net/post-max-size
post_max_size = 8M
Mchl
Don't forget post_max_size as well. It doesn't matter that upload_max_filesize=2G if post_max_size=16k
Mark Baker
@Mark, your remark is incorrect, altough uploaded files are part of post data. PHP will allow, and handle correctly, upload_max_filesize=1G with post_max_size=2M. You'll get 1G files through, but otherwise post data is limited to 2m.
jmz
There's also server-side limits, such as Apache's LimitRequestBody on top of all this.
Marc B
+2  A: 

You can limit maximum file uploaded size (you should change appropriate directives in your php.ini file). There are no other ways to limit uploaded file size.

upload_max_filesize = 1M //Maximum size of uploaded file
max_post_size = 1M //Maximum size of whole POST request
Kirzilla
Actually the quota of disk space avaialable is also a limit ;)
Mchl
+1  A: 

Yes, this is restricted specifically by upload_max_filesize and also more generally by post_max_size settings in your php.ini.

Cags
+2  A: 

You can also change limits in .htaccess file:

php_value upload_max_filesize 10M
php_value post_max_size 20M
netme