【发布时间】:2022-08-13 22:45:38
【问题描述】:
所以我创建了简单的表单来上传文件并 dd $request->file
<form
action=\"/videos\"
method=\"post\"
enctype=\"multipart/form-data\"
id=\"upload_form\"
name=\"upload_form\"
>
@csrf
<input type=\"file\" name=\"avatar\" />
<input type=\"submit\" value=\"submit\" />
</form>
dd($request->file(\'avatar\');
如果视频大于 1 mb 但小于 8 mb,则会上传错误 1,大小为 0 mb 如果视频大于 8 mb,我会收到错误
Illuminate\\Http\\Exceptions\\PostTooLargeException
PHP Warning: POST Content-Length of 21712952 bytes exceeds the limit of 8388608 bytes in Unknown on line 0
这是我在 laravel 中的 php.ini 文件
post_max_size = 100M
; upload_max_filesize = 60M
variables_order = EGPCS
max_execution_time = 3600s
memory_limit = 100M
upload_max_filesize = 60M
-
你要返回图片吗
-
如果 .ini 文件生效,您是否与
phpinfo()核对过?
标签: php laravel file-upload