Detect File Format of Encrypted Office Open XML - OOXML Files

Contents
[ ]

Aspose.Cells provides a way to detect the file format of encrypted Microsoft Open XML files. To identify the file type, use the FileFormatUtil.DetectFileFormat method as shown below in the code example.

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
//Source directory
string sourceDir = RunExamples.Get_SourceDirectory();
var filename = sourceDir + "encryptedBook1.out.tmp";
Stream stream = File.Open(filename, FileMode.Open);
FileFormatInfo fileFormatInfo = FileFormatUtil.DetectFileFormat(stream, "1234"); // The password is 1234
Console.WriteLine("File Format: " + fileFormatInfo.FileFormatType);