MicrosoftDocs / azure-docs

Open source documentation of Microsoft Azure
https://docs.microsoft.com/azure
Creative Commons Attribution 4.0 International
10.28k stars 21.47k forks source link

Possible incorrect file signature for XLS #30837

Open guardrex opened 5 years ago

guardrex commented 5 years ago

Hello - Working your code into our File Upload example updates on https://github.com/aspnet/AspNetCore.Docs/issues/10214. You have the format signature for XLS (.xls) as ...

0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1, 0x09, 0x08, 0x10, 0x00, 0x00, 0x06, 0x05, 0x00, 0xFD, 0xFF, 0xFF, 0xFF

... but that doesn't seem to match an XLS file.

@Rutix suggested ...

0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1

... but that's the same signature as a DOC (.doc) file.

I'll go with @Rutix's suggestion until I hear back: Are you able to determine a specific XLS (.xls) signature.

If I come across one in my research, I'll post it to this issue.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

guardrex commented 5 years ago

Thus far, determined that that sig is a general "MS Office Document." It also applies to other Office products of that era (97/2003).

[EDIT] ... and it looks like the latter Office is the same across the board: 0x50, 0x4B, 0x03, 0x04.

SaurabhSharma-MSFT commented 5 years ago

@guardrex Thanks for your feedback! We will investigate and update as appropriate.

Rutix commented 5 years ago

@SaurabhSharma-MSFT If you want I can provide a XLS file which doesn't satisfy 0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1, 0x09, 0x08, 0x10, 0x00, 0x00, 0x06, 0x05, 0x00, 0xFD, 0xFF, 0xFF, 0xFF

This breaks down to: 0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1 which indicates it's a microsoft office document. 0x09, 0x08, 0x10, 0x00, 0x00, 0x06, 0x05, 0x00 at offset 512 bytes indicates spreadsheet subheader 1 0xFD, 0xFF, 0xFF, 0xFF at offset 512 bytes I would assume indicates spreadsheet subheader 2 but it's missing the last byte namely 0x10

SaurabhSharma-MSFT commented 5 years ago

@guardrex @Rutix Thanks for the feedback ! I have assigned this issue to content author to investigate and update the document as appropriate.