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

CGI script to count downloads

CGI script to count downloads CGI script to count downloadsWalter Hofmann spamdropbox at myrealbox.com
Wed Apr 4 13:08:46 EDT 2001
On Tue, 03 Apr 2001 17:25:34 +1200, Greg Ewing <greg at cosc.canterbury.ac.nz> wrote:
>
>I'm trying to write a script that will keep a count
>of the number of times a file is downloaded. So far,
>the script just takes the name of the required file,
>opens the file, and passes on its contents.

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

This will make sure the browser gets the right name and you don't have
to pipe the whole file through the cgi script.

Walter

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