A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2001-April/096284.html below:

CGI script to count downloads

CGI script to count downloads CGI script to count downloadsBen Hutchings ben.hutchings at roundpoint.com
Thu Apr 5 16:51:36 EDT 2001
kragen at dnaco.net (Kragen Sitaker) writes:

V> In article <3AC95ECE.B8F5E93E at cosc.canterbury.ac.nz>,
> Greg Ewing  <greg at cosc.canterbury.ac.nz> wrote:
> >So, my question is, can I put anything in the
> >headers of the response to give the browser a
> >hint as to what name the file should be saved
> >under?
> >
> >Or is there a better way of going about this
> >whole counting business?
> 
> Perhaps you could make the URL end with download.py/foo/bar/baz.tar.gz
> instead of using a query; then just use PATH_INFO instead of a form
> value.  Is that possible?
> 
> >  #!/usr/local/cosc/bin/python
> >  print "Content-Type: compressed/gzip"
> 
> I don't think that's correct ;)
<snip>

There isn't a registered type for tar files, but I believe the type
name usually used is 'application/x-tar' (or 'application/x-gtar' if
using GNU's tar format).  Since it's gzipped, there should also be a
'Content-Encoding: gzip' field.

-- 
Any opinions expressed are my own and not necessarily those of Roundpoint.

More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4