1

I have simple html form with post method, which sends an image to my action.php file:

<form action="action.php" method="post" enctype="multipart/form-data">
    <input type="text" name="name"/>
    <input type="file" name="avatar"/>
    <input type="submit" name="submit" value="Create"/>
</form>

And my action.php file looks like this:

if(isset($_POST['name'])) {
      $error = $_FILES['avatar']['error'];
      echo $error;
}

It works fine with small sized images, but when I try to submit images with approximately 2mb size the server just stops responding. It even doesn't send post request to my action.php.

Note: I've already set my upload_max_filesize = 64M, but the same thing is happening. It doesn't show any errors

turbo
  • 1,233
  • 14
  • 36
user3260312
  • 241
  • 1
  • 4
  • 9

1 Answers1

0

Change the value of post_max_size = 70M. Must be greater than or equal to upload_max_filesize.

After modifying php.ini file(s), you need to restart your HTTP server to use new configuration.

If problem persist you could try these solutions (1,2,3).

Community
  • 1
  • 1
Abey
  • 1,408
  • 11
  • 26