Re: [twsocket] Proposal for more contenttypes in DocumentToContentType in OverbyteIcsHttpSrv.pas
> Hello! > > > else if (Ext = 'doc') or (Ext = 'docx') then > > Result := 'application/msword' > > else if (Ext = 'xls') or (Ext = 'xlsx') then > > Result := 'application/vnd.ms-excel' > > else if (Ext = 'ppt') or (Ext = 'pptx') then > > Result := 'application/vnd.ms-powerpoint' > > In my opinion, such things shouldn't be kept in component's > source code. > There should be external (or stored as resource) > configuration file that contains all extension-content type pairs. > I agree, in fact, it should be a callback or a virtual helper method. I have situations where the content type is depended on the client (don't ask, UPnP does it to you) or depend on the application. It is not very nice to have to edit the ICS sources at all in this cases. Also in the THttpConnection.SendDocument would benefit from a callback (either to a client or a virtual method) to add some things to the header before it is send. Regards Lars -- 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
Re: [twsocket] Proposal for more contenttypes in DocumentToContentType in OverbyteIcsHttpSrv.pas
Hello! > else if (Ext = 'doc') or (Ext = 'docx') then > Result := 'application/msword' > else if (Ext = 'xls') or (Ext = 'xlsx') then > Result := 'application/vnd.ms-excel' > else if (Ext = 'ppt') or (Ext = 'pptx') then > Result := 'application/vnd.ms-powerpoint' In my opinion, such things shouldn't be kept in component's source code. There should be external (or stored as resource) configuration file that contains all extension-content type pairs. -- Piotr Dałek enigmati...@interia.pl -- Wygraj telefon HTC Touch Diamond 2. Sprawdź >> http://link.interia.pl/f233f -- 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
[twsocket] Proposal for more contenttypes in DocumentToContentType in OverbyteIcsHttpSrv.pas
else if (Ext = 'doc') or (Ext = 'docx') then Result := 'application/msword' else if (Ext = 'xls') or (Ext = 'xlsx') then Result := 'application/vnd.ms-excel' else if (Ext = 'ppt') or (Ext = 'pptx') then Result := 'application/vnd.ms-powerpoint' Regards Bjørnar -- 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