public async Task <IActionResult> Post([FromFile] UserFile file) { //if (file == null || !file.IsValid) // return new JsonResult(new { code = 500, message = "不允许上传的文件类型" }); string newFile = string.Empty; if (file != null) { newFile = await file.SaveAsChunks("images"); } return(new JsonResult(new { code = 0, message = "成功", url = newFile })); }