2

The video upload works fine with a 23 MB file, for example, but when I try a 38 MB file (or anything larger than that), after about 10 or 15 seconds, it fails with a 413 error.

I've modified my php.ini with the following settings:

memory_limit = 5000M
upload_max_filesize = 500M
post_max_size = 500M
max_input_time = 60

I've confirmed by looking at phpinfo.php that these settings are in effect.

I've also gone into IIS and increased the uploadReadAheadSize from 49152 to 491520000 bytes, and restarted the server.

The machine itself is running Windows Server 2016 with 32 GB of RAM.

All of these settings appear to be sufficient to upload a 38 MB file and yet I'm running into this error which tells me there's something else I need to check or adjust. I realize there are similar threads, but I've tried all the suggested solutions and still it doesn't work, so I need a different solution.

EDIT: My form looks like this.

<form id='upload_video_form' enctype='multipart/form-data' style='height:0px;margin:0px'>
<input type='file' style='display:none' accept='video/*' name='upload_video_file' id='upload_video_file' />
<input type=hidden name=upload_video_companyid value=".$companyid.">
<input type=hidden name=upload_video_childid id=upload_video_childid value='".$childid."'>
<input type=hidden name=upload_video_reportid id=upload_video_reportid value='".$mediaid."'>
</form>
Vincent
  • 1,741
  • 23
  • 35
  • Show pls your form - is there a enctype="multipart/form-data" for file field? – Maksim Jul 17 '21 at 15:30
  • I've added it to my question. Yes, it does include enctype='multipart/form-data' but I have it in the form tag, not the file field. – Vincent Jul 18 '21 at 18:36

1 Answers1

4

The Webserver might define something like "client_max_body_size" (nginx) or "LimitRequestBody" (Apache) below that size.

IIS setting, according to this article, is "maxAllowedContentLength"

https://www.inflectra.com/support/knowledgebase/kb306.aspx

PHP settings come only after the webserver...

hth

Honk der Hase
  • 2,459
  • 1
  • 14
  • 26
  • That's it! It was the maxAllowedContentLength that was defaulted to 30 MB. Thank you so much. You saved my bacon. – Vincent Jul 18 '21 at 18:42