How can detect filetype for files without extension?

Hi,

Is it possible to find out type of a file that don't have extension, for example exe, doc, pdf ,...?
Does type of a file keep any other place, for example in header of file?
If no, how can detect type of a file?

Comments

  • You can read the beginning of the file and then attempt to detect the file format. Here's a good list of file formats:
    http://www.wotsit.org/

    For example, if you want to know if a file is a BMP, then you would check that the file is at least 50 bytes in size, begins with "BM" and so on.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion