Пример #1
0
        private bool CheckIfDocumentFile(IFormFile file)
        {
            byte[] fileBytes;
            using (var ms = new MemoryStream())
            {
                file.CopyTo(ms);
                fileBytes = ms.ToArray();
            }

            return(WriterHelper.GetDocumentFormat(fileBytes) != WriterHelper.DocumentFormat.unknown);
        }
Пример #2
0
 private bool CheckIfDocumentByteFile(byte[] document)
 {
     return(WriterHelper.GetDocumentFormat(document) != WriterHelper.DocumentFormat.unknown);
 }