Table of Content
HAL Forum
procedure WebSetContentType (
string TypeString)
Description:
Sets the reply type of the http request from a web browser.
Parameters:
TypeString Content type text.
procedure SetContentTypeForExtension(string ext)
begin
  switch (ext) begin
    case "css" : WebSetContentType("text/css");
    case "jpg" : WebSetContentType("image/jpeg");
    case "jpeg" : WebSetContentType("image/jpeg");
    case "png" : WebSetContentType("image/png");
    case "gif" : WebSetContentType("image/gif");
    case "htc" : WebSetContentType("text/x-component");
    case "exe" : WebSetContentType("application/binary");
    case "bin" : WebSetContentType("application/binary");
    case "obj" : WebSetContentType("application/binary");
    case "hpf" : WebSetContentType("application/binary");
    case "hob" : WebSetContentType("application/binary");
    case "dat" : WebSetContentType("application/binary");
    case "swf" : WebSetContentType("application/x-shockwave-flash");
    case "pdf" : WebSetContentType("application/pdf");
    case "zip" : WebSetContentType("application/zip");
    case "txt" : WebSetContentType("text/plain");
    case "xml" : WebSetContentType("text/xml");
    case "xsl" : WebSetContentType("text/xsl");
    case "htm" : WebSetContentType("text/html");
    case "html" : WebSetContentType("text/html");
    otherwise
      WebSetContentType("application/binary");
  end;
  return;
end;
Related topics:
««