常用方法
常用方法
常用方法
常用方法
public IActionResult Load() { var user = GetUser(); if (!ImageService.CanLoad(user)) { return(new UnauthorizedResult()); } foreach (var file in Request.Form.Files) { if (!ImageService.CheckFile(new FileDTO { Size = file.Length, Type = Path.GetExtension(file.FileName) })) { continue; } file.CopyTo(new FileStream(ImageService.ImageFolder + file.FileName, FileMode.CreateNew)); } return(new OkResult()); }