如何将图像文件分配给 IFormFile 变量?
using Microsoft.AspNetCore.Http;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
namespace IFrameTesting.ViewModels
{
public class ImageModelViewModels
{
[Display(Name ="Photo")]
public IFormFile Photo { get; set; }
public byte[] ImageData { get; set; }
[Display(Name = "Converted Photo")]
public IFormFile ConvertedIFormFilePhoto { get; set; }
}
}
我已成功转换并存储到服务器端图像。我想从服务器端获取该图像并分配给变量ConvertedIFormFilePhoto如何实现?
假设soultion里面有图片探索路径是wwwroot/images/abc.jpg,我想把这个abc.jpg赋值给变量ConvertedIFormFilePhoto怎么实现呢?