i'm creating a simple content management system for a website and i want to upload two images one is a thumbnail and the other is something like 1920 x 5036 px .
I have this:
HTML (upload.html):
<form action="upload.php" method="post" enctype="multipart/form-data">
<p>Pictures:
<input type="file" name="img[]" />
<input type="file" name="img[]" />
<input type="submit" value="Send" />
</p>
</form>
PHP (upload.php) :
$uploaddir = 'images/';
foreach ($_FILES["img"]["error"] as $key => $error) {
if ($error == UPLOAD_ERR_OK){
$tmp_name = $_FILES["img"]["tmp_name"][$key];
$name = $_FILES["img"]["name"][$key];
move_uploaded_file($tmp_name, "images/$name");
}
}
php.ini:
memory_limit=500M
max_input_time=300
post_max_size=40M
upload_max_filesize=10M
max_file_uploads=10
The first image i'm uploading have the next specs:
name: project02_thumb
1900 x 1307 px
1.69 MB
That image get's uploaded, and moving to the right folder.
The Second image specs:
name: project02
1920 x 5036 px
3.19 MB
The second image never gets uploaded. What can i do more?
i dont get any error on the screen.
Solution
The problem was not from the high resolution images.
I had to change upload_max_filesize and post_max_size to 40M
in ALL PHP.INI files.
with xampp v3.2.2
in C:\xampp\php there are 3 files with php.ini name.
php.ini
php.ini-development
php.ini-production