in reply to Discvering the MIME type of a document from its content

File::MMagic and File::Mimeinfo are two modules that can try to find out the mime type, and from the mime type you can infer the default extension. Let me recommend to you that you still keep the old extensions and only append the new extensions to keep the old "ownership" data around. This will preserve the information available.

  • Comment on Re: Discvering the MIME type of a document from its content