Detect File Format of Encrypted Office Open XML - OOXML Files
Contents
[
Hide
]
Office Open XML (also known as OOXML or Microsoft Open XML (MOX)) is an XML-based file format developed by Microsoft for representing office documents like spreadsheets, charts, presentations, and word processing documents.
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); |