Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting recognition of file type for Office 2007 documen
Message
De
18/06/2012 09:53:16
 
 
À
16/06/2012 01:26:14
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01546122
Message ID:
01546216
Vues:
35
>>I would have done a data driven approach, having a table the extension as a primary/unique key, a column for a description, and a column for the definition, then in your procedure you just loop the table searching for a matching definition, that way you do not need to change the code every time you've got a new extension to work with (still you will need to have code for exceptions like you have for word) and the code would be much shorter and simpler.
>
>It's highly difficult as some file types have more than one signature, there is a major exception for Microsoft Office 2007 files where we have to unzip, XML it and get the specific tag to collect a related signature, and various other formats where the signature may be a combination of startup characters as well as lookup in the binary data for specific hexadecimal sequence and with a possible lookup at the end of the file for another signature as well.

Have you tried the Scripting.FileSystemObject? The FIle object has a Type property that contains the description of the type of file it is. I not sure if it is determined by the contain oor the file name extension.
Greg Reichert
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform