[Qt-interest] Identify mimetype

Atlant Schmidt aschmidt at dekaresearch.com
Mon Mar 7 15:14:17 CET 2011


Marcelo:

  It's somewhat system dependent, isn't it?

  For files delivered to a browser using HTTP, yes, there's usually an
  explicit MIMETYPE.

  But on DOS/Windows, the filetype is used to identify the contents
  of the file (and could therefore be used to display a customized icon).

  On Mac OS prior to Snow Leopard, the Finder Information Block for the
  file contained this information. And with  Snow Leopard, Apple have
  gone to using the filetype instead.

  On Unix/Linux, there's nothing that really enforces the relationship
  between files and the type of contents they contain. File paths *MAY*
  contain some characters after a dot (for example, ".cpp") and that
  *MAY* hint at what's in the file, but it's not enforced. A magic number
  in the first two or four bytes of the file contents is sometimes used
  instead.

  What I'm saying is you may need to ask a more-bounded question;
  it's not clear to me that files "in the most general sense" have a
  MIMETYPE.

                                 Atlant

________________________________
From: qt-interest-bounces+aschmidt=dekaresearch.com at qt.nokia.com [mailto:qt-interest-bounces+aschmidt=dekaresearch.com at qt.nokia.com] On Behalf Of Marcelo Estanislau Geyer
Sent: Monday, March 07, 2011 08:03
To: qt-interest at qt.nokia.com
Subject: [Qt-interest] Identify mimetype

Hi,
I have not found a way to identify the mimetype of a file. I need to display the icon for the file format. Any suggestion is welcome, need something cross platform (Linux and Windows). Thanks

Marcelo E. Geyer
Click here<https://www.mailcontrol.com/sr/OoZrMb11esjTndxI!oX7Uj80y4Ou3KxpMB5yrizXYNf9xyfrXFQS9VAroEG87DLC+LQuquxFkFWz5oFEicUPXg==> to report this email as spam.

________________________________
This e-mail and the information, including any attachments, it contains are intended to be a confidential communication only to the person or entity to whom it is addressed and may contain information that is privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the sender and destroy the original message.

Thank you.

Please consider the environment before printing this email.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110307/bd031a74/attachment.html 


More information about the Qt-interest-old mailing list