我正在尝试让我的网站上传视频和图片。由于我制作了更多上传图片的网站,因此在这方面没有问题,但是当我出于某种原因尝试上传视频时,在$_FILES包含上传图像的数组中找不到它。
我已经在谷歌上搜索并找到了关于 php.ini 文件和包含最大上传大小的 IIS 7 的内容。这些都设置为 1024M:
在 php.ini 中:
max_execution_time = 1000
max_input_time = 1000
memory_limit = 256M
upload_max_filesize = 1024M
post_max_size = 1024M
Run Code Online (Sandbox Code Playgroud)
在 IIS 7 中:
maxAllowedContentLength = 1073741824
maxRequestLength = 1073741824
Run Code Online (Sandbox Code Playgroud)
经过一些测试,看起来很小的视频文件确实可以工作(192KB),但稍大的文件在 $_FILES 数组(11MB)中没有显示任何内容,但真正大的文件(80MB)给出了一个错误:The request filtering module is configured to deny a request that exceeds the request content length.. 问题是我已将其设置maxAllowedContentLength为 1GB。所以这不应该发生?!这张图片如下:

任何帮助或建议都非常感谢!
HTTP 错误 404.13 表示 IIS7 请求过滤模块由于请求过大而正在终止请求。
增加此maxAllowedContentLength值的正确方法是在 system.webServer > security > requestFiltering站点的web.config.
例如:
<configuration>
<system.webServer>
<security>
<requestFiltering>
<!-- Allow 100MB requests -->
<requestLimits maxAllowedContentLength="100000000" />
</requestFiltering>
</security>
</system.webServer>
</configuration>
Run Code Online (Sandbox Code Playgroud)
有关更多信息,请参阅:
| 归档时间: |
|
| 查看次数: |
3321 次 |
| 最近记录: |