Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學

解決 IIS 7.0 上傳超過 30MB 影片出現「找不到檔案或目錄」錯誤

編輯:Windows Server 常見問題解答

IIS 7.0 預設限制上傳檔案大小為 30MB (maxAllowedContentLength = 3000000 bytes),超過即回傳 404 錯誤。需修改 IIS_schema.xml 放寬限制。

修改步驟

  1. 取得檔案控制權:C:\Windows\System32\inetsrv\config\schema\IIS_schema.xml → 右鍵內容 → 安全性 → 進階 → 擁有者 → 變更為 Administrators → 給予 完全控制 → 取消「唯讀」屬性
  2. 以文字編輯器開啟 IIS_schema.xml,搜尋 3000000 (約第 1024 行)
  3. 修改 maxAllowedContentLength 屬性值,例如改為 300000000 (300MB):
    <attribute name="maxAllowedContentLength" type="uint" defaultValue="300000000" />
  4. 儲存檔案,執行 iisreset 重啟 IIS 服務

IIS_schema.xml 權限設定 進階安全性設定 變更擁有者 選擇 Administrators 給予完全控制

同樣適用於 IIS 7.5/8.0/8.5,修改後可支援大型媒體檔案上傳。

Copyright © Windows教程網 All Rights Reserved