> 
> > I don't know if you are parsing mail or something else,
> 
> Isolated file.
> 
> > If you are trying to figure it out magically based on just 
> the file format
> or filename or
> > something (e.g. just pointing it at a raw jpeg) I didn't 
> think MIME::
> would help.
>
> Unfortunately I have to rely on the standard install of ActivePerl and
> didn't want to make assumptions based on the extension type 
> of the file.
> Never mind, I will have to investigate further for future 
> use. Thanks for
> the help.

Open up the file, read in the first few bytes and grab the magic number.
Most types of binary file have a marker of some kind to designate what they
are. Any half decent book on graphics programming should be able to tell you
what the magic numbers are for the main graphics types.

You can also use this technique to scan hdd's for for files where the file
extension has been changed to 'hide it'.

I had to look up the numbers a while ago for some software that performed
said scan. It's possible I've still got them somewhere... if I have, I'll
let you know (or point you in the right direction).

Rob


---------------------------------------------------------------
Any views expressed in this message are those of the individual sender,
except where the sender specifically states them to be the views of IBNet
Plc. 

This message contains confidential information and is intended only for the
individual named. If you are not the named addressee you should not
disseminate, distribute or copy this e-mail.  Please notify the sender
immediately by e-mail if you have received this e-mail by mistake and delete
this e-mail from your system. 

E-mail transmission cannot be guaranteed to be secure or error-free as
information could be intercepted, corrupted, lost, destroyed, arrive late or
incomplete, or contain viruses. The sender therefore does not accept
liability for any errors or omissions in the contents of this message which
arise as a result of e-mail transmission. If verification is required please
request a hard-copy version. 

Reply via email to