Sachindra
Sachindra

Reputation: 6979

php file uploads' size

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 ..

Upvotes: 0

Views: 464

Answers (4)

Mchl
Mchl

Reputation: 62369

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

Upvotes: 8

Mikhail Chernykh
Mikhail Chernykh

Reputation: 2697

You can also change limits in .htaccess file:

php_value upload_max_filesize 10M
php_value post_max_size 20M

Upvotes: 2

Peter O'Callaghan
Peter O'Callaghan

Reputation: 6186

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

Upvotes: 1

Kirzilla
Kirzilla

Reputation: 16596

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

Upvotes: 2

Related Questions