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