[2005] determine file type without extension
does anyone know of a way to determine the type of file without using the file extension? i know there must be a way because this one particular application call ApplicationXtender does this with files. it changes a files extension to a .bin for displaying the image or document, it also changes the name of the file to an id that it stores in the database. if you know which file the id belongs to you can change the file extension to lets say .tif, .pdf, or even .doc and it will work. so i'm assuming that this application is looking at the binary data that's in the file or using some kind of mime functionality to determine the file type.
Re: [2005] determine file type without extension
All file formats have a format. If you know what that format is then you can test for it and, if you find it, you can then assume that the file is that format. You need to know the format for every file type you want to be able to identify.
I could be wrong but from what you've said I'd guess that this ApplicationXtender probably stores a file's type in its database before changing the extension. It then uses that information to identify the format instead of the actual extension.