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/109448.html below:

CGI script to count downloads

CGI script to count downloads CGI script to count downloadsSteve Purcell stephen_purcell at yahoo.com
Fri Apr 6 03:23:04 EDT 2001
Greg Ewing wrote:
> Walter Hofmann wrote:
> > Use the following commands to redirect the browser to the "real" URL
> > where the file is located:
> > 
> > print "Location: http://server/real/url.tar.gz"
> > print "Status: 302 Found"
> > print
> 
> That's the solution I finally adopted. Thanks to
> all who replied.

The disadvantage of this approach is that you can't accurately count
*completed* downloads, but that may not be an issue for you.

> By the way, it seems to work with just the
> "Location:" line. What does the "Status:"
> line do? Will anything bad happen if I
> leave it out?

Probably the web server is guessing the 'Status:' based on the 'Location:'
header. You should put the 'Status' header in yourself for the sake of
completeness and portability.

-Steve

-- 
Steve Purcell, Pythangelist
Get testing at http://pyunit.sourceforge.net/
Any opinions expressed herein are my own and not necessarily those of Yahoo


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