> We want to make sure that the file is a valid format of the file that it says 
> that
> it is. Examples: Is the file MyFile.PDF a valid PDF file? Is the file
> MyFile.xlsx a valid Excel file?

I don't think such a global tool or methodology exists, probably for a
good reason. 

Taking even PDF or XLSX, how do you even establish if the format is
valid? If Acrobat or Excel can be automated programmatically to open
them, they're presumably almost certainly valid, so you could check that
for each file type. That's probably the most you could hope to achieve.
Maybe check the file header for the byte signature of the file types,
but does a database of those signatures exist for every type you might
have to deal with?

Going further would you really want to re-engineer all the code those
applications have to open a file and populate the required internal
memory structures and figure out what internal checks they do to decide
"yep, that looks OK" ? 



-- 
  Alan Bourke
  alanpbourke (at) fastmail (dot) fm


_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/1471447950.1199545.698094241.323fb...@webmail.messagingengine.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to