Google Answers Logo
View Question
Q: Mime types and Visual Basic ( No Answer,   3 Comments )
Subject: Mime types and Visual Basic
Category: Computers > Software
Asked by: johngl-ga
List Price: $5.00
Posted: 15 Jul 2004 16:03 PDT
Expires: 14 Aug 2004 16:03 PDT
Question ID: 374693
How can I determine the mime type of a file by it's extention, i.e.
.html, .avi, .jpg, etc., (or by the file's contents) in Visual Basic
6.0?  Thank you.

Clarification of Question by johngl-ga on 15 Jul 2004 17:23 PDT
Will doing something like looking up the following work on all Window
systems 95 and above?

Registry entry:

HKEY_CLASSES_ROOT/.gif/Content Type

Can I look up the various extensions this way on all windows versions
(95 and above) and get what I need?  This works great on Windows 2000
but will it work on 95, 98, ME, XP, etc.?  Thank you.
There is no answer at this time.

Subject: Re: Mime types and Visual Basic
From: macabre-ga on 16 Jul 2004 05:47 PDT
The mime type is just a mapping that is managed by the operating
system, and users can defeat it if they like. There is a very broad
listing of "standard" mime types here: . Depending on what
you're using this information for, it may be more appropriate to
manage a table of types in your application than trust the system it
is installed on.
Subject: Re: Mime types and Visual Basic
From: johngl-ga on 16 Jul 2004 12:33 PDT
I need to be able to do it by file extension or the data itself.  I'm
having trouble finding a good source for both pieces of data.  Thank
Subject: Re: Mime types and Visual Basic
From: macabre-ga on 16 Jul 2004 12:46 PDT
You could borrow the type <-> extension mapping from the Apache
configuration file (mime.types). Here's an example: (note that
this file contains many types that don't have related extensions, so
you could ignore those for this purpose)

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  

Google Home - Answers FAQ - Terms of Service - Privacy Policy