Unable to upload "large" files, both file_exists() and is_uploaded_file() are false

Stephanie :

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.

Stephanie :

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

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=12393&siteId=1