public FileBytes(string name, byte[] bytes, string id = null) { FileName = name; Bytes = bytes; Extension = Path.GetExtension(name); MimeType = MimeData.GetFileMimeType(name); }
public FileBytes(string filePath) { FileName = Path.GetFileName(filePath); Extension = Path.GetExtension(filePath); MimeType = MimeData.GetFileMimeType(FileName); if (File.Exists(filePath)) { Bytes = File.ReadAllBytes(filePath); } }
public void SetFileName(string name) { FileName = name; Extension = Path.GetExtension(name); MimeType = MimeData.GetFileMimeType(name); }