private async Task <string> UploadImageToS3(ImageModel imageModel) { string imageKey = string.Empty; using (var fileStream = imageModel.ImageFile.OpenReadStream()) { using (var ms = new MemoryStream()) { await fileStream.CopyToAsync(ms); imageKey = await _awsS3service.UploadFileAsync(ms); } } return(imageKey); }
public async Task <IActionResult> AddFileToS3(string bucketName) { await _service.UploadFileAsync(bucketName); return(Ok()); }