Alexandre Cristo
Alexandre Cristo

Reputation: 331

PHP move_uploaded_file not working when uploading too many files

I have created a HTML form where the user has to enter some information about houses and upload some photos to create an advertisement for that house. When the user sends the form (via POST) with just one or two photos, the script works fine and the photos are uploaded to the right place, but when the user tries to send, for example, twelve photos, the script doesn't even enter inside the if(isset($_POST['submit'])) block. Here is just a part of my code because it is pretty extensive?

[Stripped code as it is unrelated to the issue (history)]

Am I doing something wrong?

Upvotes: 1

Views: 72

Answers (1)

Marcin Orlowski
Marcin Orlowski

Reputation: 75629

You are reaching PHP limits. So either disallow so much data in one request or tune up your PHP and increase at least these:

; Maximum allowed size for uploaded files.
upload_max_filesize = ...

; Must be greater than or equal to upload_max_filesize
post_max_size = ...

Upvotes: 2

Related Questions