How to save a file on a users computer with cgi

Alex Martelli aleax at
Fri Jan 4 11:17:47 CET 2002

"Bragi Baldursson" <bragiba at> wrote in message
news:abcf4a18.0201040208.2bda19d9 at
> I am writing a small cgi script that I would like to write a small
> file with user relevant information to his/her hard disk.
> How do I accomplish this?
> Can I also detect the presence of certain files on his hard disk?

No, the Common Gateway Interface (CGI) standard does not allow
your program (running on the server) to do anything regarding
the user's filesystem (on the client).  You can probably achieve
your goals by using Cookies instead -- small snippets of info to
be stored client-side (subject to acceptance by the user) and
transparently recovered later (when the same URL, or an URL on the
same site, is later visited).  See module Cookie in the standard
Python library, for example.


More information about the Python-list mailing list