如何修复大文件上传错误 404 在 IIS 上 | 分步指南. The following error occurs when uploading large files to the website.
Server Error
404 – File or directory not found.
The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.
To enable uploading large files you have to change a setting in IIS.
笔记: The limit is approximately 28,6 MB because the limit of maxAllowedContent Length 是 30000000 字节.
To change the maximum upload setting, named “maxAllowedContent Length”, 执行以下操作:
1. Log on to the server that holds the IIS website, 然后单击 开始, 点击 Programs, 点击 管理工具, 点击 Internet Information Services (信息系统) 经理;
2. Expand the website that you want to increase the maxAllowedContent Length;
3. 双击 Request Filtering icon in the main window
笔记: if you don’t have the Request Filtering icon, you need to install it through the Add Roles 选项. Get the instructions below.
4. 单击 Hidden Segment Tab;
5. Right-click web.config 然后单击 Edit Feature Setting;
6. A new window named Edit Request Filtering Settings appears;
7. 在下面 Request Limits heading. enter a new larger value in the Maximum allowed content length (Bytes) box;
8. 点击 好的 to apply the change.
Setup Request Filtering
The default installation of IIS 7 and later includes the Request Filtering role service or feature. If the Request Filtering role service or feature is uninstalled, you can reinstall it using the following steps.
Windows服务器 2012 R2
1. On the taskbar, 点击 服务器管理器.
2. 在 服务器管理器, 单击 Manage menu and then click Add Roles and Features.
3. 在 Add Roles and Features wizard, 点击 下一个. Select the installation type and click 下一个. Select the destination server and click 下一个.
4. 上 Server Roles 页, 扩张 Web Server (信息系统), 扩张 Web Server, 扩张 安全, 然后选择 Request Filtering. 点击 下一个.
5. 上 Select features 页, 点击 下一个.
6. 上 Confirm installation selections 页, 点击 安装.
7. 上 Results 页, 点击 关闭.
How To
Note for IIS 7.0 用户: Some of the steps in this section may require that you install the Microsoft Administration Pack for IIS 7.0, which includes a user interface for request filtering. To install the Microsoft Administration Pack for IIS 7.0, please see the following URL iis.net/expand/AdministrationPack
How to add a hidden segment
- 打开 Internet Information Services (信息系统) 经理:
- If you are using Windows Server 2012 or Windows Server 2012 R2:
- On the taskbar, 点击 服务器管理器, 点击 Tools, 然后单击 Internet Information Services (信息系统) 经理.
- If you are using Windows 8 or Windows 8.1:
- Hold down the 视窗 钥匙, press the letter X, 然后单击 控制面板.
- 点击 管理工具, and then double-click Internet Information Services (信息系统) 经理.
- If you are using Windows Server 2008 or Windows Server 2008 R2:
- On the taskbar, 点击 开始, point to 管理工具, 然后单击 Internet Information Services (信息系统) 经理.
- If you are using Windows Vista or Windows 7:
- On the taskbar, 点击 开始, 然后单击 控制面板.
- Double-click 管理工具, and then double-click Internet Information Services (信息系统) 经理.
- If you are using Windows Server 2012 or Windows Server 2012 R2:
- 在 Connections pane, go to the connection, site, application, or directory for which you want to modify your request filtering settings.
- 在 家 pane, double-click Request Filtering.
- 在 Request Filtering pane, 单击 Hidden Segments 选项卡, 然后单击 Add Hidden Segment… 在 动作 pane.
- 在 Add Hidden Segment 对话框, enter the relative path that you want to hide, 然后单击 好的.