[Lazarus] Function to get the mimetype from a file extension

Žilvinas Ledas zilvinas.ledas at dict.lt
Wed May 9 14:32:26 CEST 2012


Hi,

you should look at turbopower_ipro/iputils.pas - it has
function GetLocalContent(const TheFileName: string): string;
with valid windows implementation and array-lookup for other OS'es.

Also there is lmimewrapper.pp in LNet:
procedure TMimeFileSection.SetContentType(const aFileName: string);

it has a big IF statement for selecting type.


Regards,
Žilvinas

On 2012-05-09 14:39, Felipe Monteiro de Carvalho wrote:
> Hello,
>
> I need this now and after some Googling I couldn't find anything. So I
> was wondering, maybe we already have this somewhere in FPC or Lazarus?
> If not it might be something to consider adding to LazUtils.
>




More information about the Lazarus mailing list