我发现不足50KB的很小的图片可以正常上传,一旦稍微大一点的图片上传就报错, 紧接着F5调试中断退出,iis弹出提示关闭,然后浏览器报了一个404的错误,
Failed to load resource: the server responded with a status of 404 (Not Found)
public class UEditorController : Controller { private readonly UEditorService _ueditorService; public UEditorController(UEditorService ueditorService) { this._ueditorService = ueditorService; } [HttpGet, HttpPost] public ContentResult Upload() { try { var response = _ueditorService.UploadAndGetResponse(HttpContext); return Content(response.Result, response.ContentType); } catch (Exception ex) { string mes= ex.Message; return null; } } }
404不是找不到文件吗?
嗯,404是因为报错后报的404,这个代码有问题,如果没有出现报错的情况是不会打印404的
@大da脸: 你上传文件怎么写的
@灬丶: 就是上面的代码
下断点 具体到哪一步报的错