示例#1
0
 public IActionResult UploadAvatar(IFormFile file)
 {
     using Stream stream = file.OpenReadStream();
     try
     {
         return(Content(ossService.UploadAvatar(stream)));
     }
     catch (System.Exception ex)
     {
         Response.StatusCode = 500;
         return(Content(ex.Message));
     }
 }
 public IActionResult UploadAvatar(IFormFile file)
 {
     using Stream stream = file.OpenReadStream();
     try
     {
         ossService.UploadAvatar(stream);
         return(Ok());
     }
     catch (Exception)
     {
         return(NotFound());
     }
 }