Se the new content-type at the bottom (xml):
function DocumentToContentType(FileName : String) : String;
var
Ext : String;
begin
{ We probably should use the registry to find MIME type for file types }
Ext := LowerCase(ExtractFileExt(FileName));
if Length(Ext) > 1 then
Ext := Copy(Ext, 2, Length(Ext));
if (Ext = 'htm') or (Ext = 'html') then
Result := 'text/html'
else if Ext = 'gif' then
Result := 'image/gif'
else if Ext = 'bmp' then
Result := 'image/bmp'
else if (Ext = 'jpg') or (Ext = 'jpeg') then
Result := 'image/jpeg'
else if (Ext = 'tif') or (Ext = 'tiff') then
Result := 'image/tiff'
else if Ext = 'txt' then
Result := 'text/plain'
else if Ext = 'css' then
Result := 'text/css'
else if Ext = 'wav' then
Result := 'audio/x-wav'
else if Ext = 'ico' then
Result := 'image/x-icon'
{ WAP support begin }
else if Ext = 'wml' then
Result := 'text/vnd.wap.wml'
else if Ext = 'wbmp' then
Result := 'image/vnd.wap.wbmp'
else if Ext = 'wmlc' then
Result := 'application/vnd.wap.wmlc'
else if Ext = 'wmlscript' then
Result := 'text/vnd.wap.wmlscript'
else if Ext = 'wmlscriptc' then
Result := 'application/vnd.wap.wmlscriptc'
{ WAP support end }
else if Ext = 'pdf' then
Result := 'application/pdf'
else if Ext = 'xml' then
Result := 'text/xml'
else
Result := 'application/binary';
end;
Regards Bjørnar
No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.9/1364 - Release Date: 07.04.2008
18:38
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be