常見原因
- 上傳目錄無寫入權限:IIS_IUSRS / ApplicationPoolIdentity 需對 `upload/image` 目錄有 **Modify** 權限。
- 配置路徑錯誤:`config.json` 中 `imagePathFormat`、`imageUrlPrefix` 需與站點物理路徑一致。
- 處理程序未註冊:`web.config` 需註冊 `UEditorHandler.ashx` (或 `.ashx` 映射)。
- 文件大小限制:`config.json` `imageMaxSize`、IIS `maxAllowedContentLength`、ASP.NET `httpRuntime maxRequestLength`。
排查步驟
- 瀏覽器 F12 Network 看上傳請求響應:`{"state":"SUCCESS"}` 還是錯誤碼。
- 服務器日志 (UEditor 內部日志 / IIS 日志) 看詳細異常。
- 手動在服務器用同身份運行 `echo test > upload/image/test.txt` 驗證權限。
參考
UEditor .NET 版官方文檔:服務端部署指南