is there a way i can look at a file and see its type. i need to make a program that scans files and determins if the file extenstion is correct based on the actual file type.
this, for example, would find a ".zip" file hidden with a ".jpg" extension
any ideas?

i don't think so, at least not easily. all files are basically just a long string of bytes. The extension tells windows (or whatever OS you are using) what to do with that string. By changing the extension, say from .jpg to .txt, you are, in essence, making that jpg into a text file. Now certain extensions are expected to have certain formats and probably will not work properly if you change the extension. But other than doing a bytewise scan looking for certain patterns, which would be beyond my skill level, I don't think there is a way to do what you want. Any more experienced programmers have any ideas? Or am I completely full of you know what here?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.