Question : bytes to httppostedfilebase c#
Answered by : dull-dogfish-2c6brikmeeul
public class MemoryPostedFile : HttpPostedFileBase
{ private readonly byte[] fileBytes; public MemoryPostedFile(byte[] fileBytes, string fileName = null) { this.fileBytes = fileBytes; this.FileName = fileName; this.InputStream = new MemoryStream(fileBytes); } public override int ContentLength => fileBytes.Length; public override string FileName { get; } public override Stream InputStream { get; }
}
Source : https://stackoverflow.com/questions/39094997/how-to-convert-a-byte-to-httppostedfilebase-using-c-sharp | Last Update : Sun, 06 Dec 20