如何获取上传图片的文件流(IFormFile
)并调整大小?
public ActionResult Upload(IFormFile file)
{
using (var reader = new StreamReader(file.OpenReadStream()))
{
var fileContent = reader.ReadToEnd();
var parsedContentDisposition = ContentDispositionHeaderValue.Parse(file.ContentDisposition);
//scale image here?
}
}