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
"Anthony Jones" wrote:
> 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.
>
>
>
|