I'm working on a simple html form to upload an image, then save it on a directory situated on my localhost.
<form action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']);?>" enctype="multipart/form-data" method="post">
<label for="img">Pick a picture</label>
<input id="img" type="file" name="image">
<input type="submit" name="imageProfil" value="Upload the image">
</form>
However, when I handle the image, while checking errors (in $_FILES['image']['errors'], I'm getting an error 3, which means the file has only been partially uploaded.
Moreover, each time I upload a file, I'm not getting any response after the first response (where the exception is thrown at me). I've done all the error checking, I did put the enctype="multipart/form-data" on my form, and I'm basically clueless right here.
Thank you for your time.
You have to check your php.ini
configuration. If your upload is constantly being interrupted, you either need to increase the maximum upload size or the maximum execution time. Check these variables:
post_max_size
upload_max_filesize
max_execution_time
memory_limit
You can either increase these values in your PHP configuration file or increase in your script using the ini_set function.