[Mono-dev] Fwd: Monorail, Mono, Content-type and the registry.....

Federico Di Gregorio fog at initd.org
Wed Mar 17 11:33:08 EDT 2010


On 17/03/2010 15:48, Rafael Teixeira wrote:
> How does one determine the mime-type of a resource (normally a file)
> in a portable way?
> I know Mono on Debian does have a dependency on the shared-mime-info
> package, so it probably wraps/uses it, but is it exposed in some
> public API? Specially some API that is available in .NET?

I had the same problem and I didn't find any portable way to determine
the MIME type of a file. In the end we resolved to just hardcode the
most common file types (by extension, sigh) into our code:

https://dndg.it/cgi-bin/gitweb.cgi?p=public/wok-2.git;a=blob_plain;f=Wok.Core/Wok.Core.Utils/MimeType.cs;hb=HEAD

-- 
Federico Di Gregorio                                       fog at initd.org
 Questa lista non pretende di essere il riferimento torinese per il
  software libero o altre cazzate del genere.       -- Silvano, su torte

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20100317/adcf1981/attachment.bin 


More information about the Mono-devel-list mailing list