Attachment file type

I have this attachment function in my Web application which allows the user to attach *.tif files only. They are only suppose to attached tif format. But the user sometime would attached a JPG file by changing the filename to end with .tif.My question is - how do i check the original file type of the attachment?

Subject: attachment file type

I would create a WebQuerySave agent, that extracts the attached file, and looks at the first four bytes of the file.

Stan describes what to look for here: http://www-10.lotus.com/ldd/nd6forum.nsf/DateAllThreadedweb/1f31422ebf719bc3852574db002058f1?OpenDocument

If the first bytes don’t conform to a TIFF file, delete the attachment.

/Peter