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 ..
2
-
is there any upper limit for the upload size?Sachindra– Sachindra2010-07-28 14:51:02 +00:00Commented Jul 28, 2010 at 14:51
-
are you using your own hosting? or provided hosting? because if you do not host yourself, chances are there is no php.ini on your ftp. If this is the case I can help you further, then commentNealv– Nealv2010-07-28 14:54:10 +00:00Commented Jul 28, 2010 at 14:54
Add a comment
|
4 Answers
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
3 Comments
Mark Baker
Don't forget post_max_size as well. It doesn't matter that upload_max_filesize=2G if post_max_size=16k
jmz
@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.
Marc B
There's also server-side limits, such as Apache's LimitRequestBody on top of all this.
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
1 Comment
Mchl
Actually the quota of disk space avaialable is also a limit ;)