httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject [users@httpd] Application design
Date Fri, 20 Mar 2009 14:46:06 GMT

For once, I'd like to pump the collective knowledge and accumulated 
wisdom of the gurus on the list.

I run a document management application, from which users can retrieve 
documents (ms-office, pdf, etc..) through a web application.  From the 
user point of view, documents are accessed via a "logical id", such as 
"12345678", via a link like "http://servername/getdoc/1234567".
An active module on the server processes these requests, determines for 
example that "12345678" corresponds to some document "doc0001.pdf", 
retrieves this document, and returns it to the user with the appropriate 
HTTP headers, for example in this case :
Content-Type : text/pdf
Content-Length: 200000
Content-Disposition: attachment; filename="doc0001.pdf"

So far, so good, it works.

Now, I would like to save space on the server, and compress the original 
documents. So I would for example take "doc0001.pdf", and compress it 
into "". (I mean really on the disk of the server, stored 
in compressed form, not just compressed "in transit".)
I would still want the user to use the same link to retrieve the 
document, and I would of course want that this is still seen as a pdf 
document by their browser, and not as a zip file.
I imagine that what I need to do then in my active module, is to return 
the zipped version of the document to the browser with the following 
headers :
Content-Type : text/pdf
Content-Disposition: attachment; filename="doc0001.pdf"
Content-transfer-encoding: zip
Content-Length: (size of the zipped version)

and that the browser will automatically uncompress it and present it to 
the user as an uncompressed pdf document.

Is that true, and is it all there is to it, or am I missing something ?

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message