1

I'm trying to upload a gif file to my server using an upload tool (ShareX)

It works very well with "small" files, but when trying to upload a 8 MB one (takes about 1 minute with my connection), it just doesn't work.

So I did some quick debug, and it seems that the functions file_exists and is_uploaded_file are both set to false, exactly like nothing was uploaded, which isn't the case.

if (!file_exists($_FILES[$fileFormName]["tmp_name"]) || !is_uploaded_file($_FILES[$fileFormName]["tmp_name"]))
{
    error([
        "error" => "No file uploaded",
        "file_exists" => file_exists($_FILES[$fileFormName]["tmp_name"]),
        "is_uploaded_file" => is_uploaded_file($_FILES[$fileFormName]["tmp_name"])
    ], "400 Bad Request");
}

Why would that happen?

My apache2 php.ini upload_max_filesize is set to 128M so it shouldn't be a file size issue.

My apache2 php.ini max_execution_time is set to 0 so it shouldn't be a timeout issue.

I wasn't able to find anything similar to my problem using Google.

Sofia
  • 93
  • 1
  • 8
  • File uploads are usually implemented using a HTTP POST request. So you also need to adjust `post_max_size` accordingly. – arkascha Feb 15 '20 at 11:59
  • @arkascha Hello and thanks for your answer, I saw this here: https://stackoverflow.com/a/8744184/12730904 at the same time you posted your comment, I'll try and let you know. – Sofia Feb 15 '20 at 12:00

1 Answers1

0

Fixed, I also had to adjust post_max_size in my php.ini file.

Sofia
  • 93
  • 1
  • 8