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

CGI script to count downloads

CGI script to count downloads CGI script to count downloadsSteve Purcell stephen_purcell at yahoo.com
Wed Apr 4 08:41:11 EDT 2001
Greg Ewing wrote:
> For instance, if the URL used to retrieve the
> file is
> 
>   download.py?file=download/akaroa2.6.1doc.tar.gz
> 
> then the default filename that Netscape gives me
> is
> 
>   akaroa2.6.1doc.tar.py
> 
> 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?


There aren't any headers that can help, AFAIK. But... you can instead make
the URL look like this:

   download.py/download/akaroa2.6.1doc.tar.gz

Browsers will determine the correct filename from this URL, and 'download.py'
can access the filename argument using the CGI variable "PATH_INFO".

-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