Reading the server mimemap.

A

Anthony Jones

Hi people,

I use the following code to read the server's mimemap and resove a file
extension to a mime type:-

Public Function GetMimeType(ByVal Extension)

Dim oMimeMap
Dim vntMimeType
Dim avntMap()

Set oMimeMap = GetObject("IIS://LocalHost/MimeMap")

If Left(Extension, 1) <> "." Then Extension = "." & Extension

avntMap() = oMimeMap.MimeMap

For Each vntMimeType In avntMap
If vntMimeType.Extension = Extension Then
GetMimeType = vntMimeType.MimeType
Exit For
End If
Next

If GetMimeType = "" Then GetMimeType = "application/octet-stream"

End Function

Problem is the GetObject requires the account underwhich this code runs to
be an Operator in WWW Service Master properties. It's undesirable to add
IUSR or IWAM as an operator.

I only want to read this information not edit. Is there any other way I can
resolve a file extension to a mime type in ASP code without elevated
priviledges?

Ta,

Anthony.
 
P

Per

Hi,

I have the same problem!
How can I set read permissions for the IUSR_MACHINENAME to retrieve the
"IIS://LocalHost/MimeMap" values.
Is there another way to retrieve these values without administrative rights.


Regards,

Per Dunberg
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,049
Latest member
Allen00Reed

Latest Threads

Top