On Fri, Jan 16, 2009 at 2:24 PM, André Warnier <aw@xxxxxxxxxx> wrote: > Hi. > > Question : > > What exact form would a HTTP response need to have, for the browser to > correctly interpret that the response it is getting is a document (for > example an OpenOffice document or an email in eml format), but which has > been zipped for transmission ? > > What I would like to happen is that the browser receives the zipped > document, but instead of proposing to open it as a zip file or save it to > disk as a zip file, unzips it and handles it properly as per the content of > the zipped response. > > I know that this has to do with the Content-Type and Content-disposition and > Content-encoding (Content-type-encoding ?) headers, but do not know exactly > what are the caveats or rules or "things that work with one browser and not > the other" kind of stuff. > > Does anyone know ? > > If more context is required : > A server-side application stores on the one hand original documents of > different kinds, zipped, and on the other hand meta-data about these > documents in a database and search-engine. > The user can search the database, and obtain a response html page, on which > appear icons representing the original documents. When clicking on such an > icon, the user should receive the original document. > It seems a pity, considering that the document is already stored zipped at > the server side, to unzip it before sending it to the browser, so that the > browser would know that it is not a zip-file, but an OpenOffice document. > The plan is thus to have, underneath the icons, a link which invokes an > application on the server (Apache module, mod_perl module, cgi-bin,..), > which retrieves the zipped original, composes the appropriate HTTP headers > (wich it can do only based on info stored in the db), and sends the document > in the appropriate way to the browser, in the zipped format. The filename of > the zipped document on the server gives no clue as to its content. Only the > meta-data in the db indicates that. > > Thanks in advance for any insights, advice, pointers etc.. I believe mod_deflate is what you're looking for: http://httpd.apache.org/docs/2.0/mod/mod_deflate.html I've never used it myself, so I'm not exactly sure what it does, but it might be on the right trail. After a quick scan of google, it looks like it's related to the content-coding HTTP header, so it might be worth reading up on that a bit more. Hope that get's you started, at least. -Brian -- Feel free to contact me using PGP Encryption: Key Id: 0x3AA70848 Available from: http://pgp.mit.edu/ --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See <URL:http://httpd.apache.org/userslist.html> for more info. To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx " from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx