Hi,

I am using the following code for determining the mimetype of a
file..............

nsresult rv;
nsXPIDLCString type;
nsCOMPtr<nsIMIMEService> mimeService =
do_GetService(NS_MIMESERVICE_CONTRACTID, &rv);
 if (NS_FAILED(rv))
 {
    return rv;
 }

rv = mimeService->GetTypeFromURI(uri, type);
if (NS_FAILED(rv))
 {
     return rv;
 }

this works only if the file has a extension.
Definiton of GetTypeFromURI says " Retrieves a ACString representation
of the MIME type associated with this URI. The association is purely
file extension to MIME type based. No attempt to determine the type via
server headers or byte scanning is made"

Is there any way of finding the mimetype or the type of the file when
there is no file extension.

Regards
Vin

_______________________________________________
dev-tech-xpcom mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-xpcom

Reply via email to