How to save a file on a users computer with cgi

Bragi Baldursson bragiba at simi.is
Fri Jan 4 16:39:48 EST 2002


What I am trying to do is the following.  I am basically trying to
write a web browser GUI to the pwman.py
(http://www.vex.net/~x/python_stuff.html).
pwman.py is a simple script using md5 decoding to store passwords in a
text file.  I wanted to provide a user interface through a cgi script
or some other way with python through a web browser on my local web
server at work.
I thought it would be a good way for people to store their passwords.

I started thinking of CGI but then was not sure about the write thing.
 Does anyone have any suggestions on how to accomplish this.  I could
allow the user to type in their own password file although I would
rather hide it from them in some rather "protected" (area where most
users would not go in to clean up or delete files) area of their OS.

I looked briefly at the Cookie module but it seems to me that you
could write a Cookie to some set location on a users OS.  But isn´t it
highly likely that the Cookie area gets cleaned out regularily???? I
need a persistent file object where I can store this.

My idea now is to go with a database of my own and have users provide
a user name and a password and I store all the password files locally
on my machine.  But then I get into a bind of having the users
information on my conscience and they might get skeptical of me.  I
would therefore much rather store their information on their
computers!


paul at boddie.net (Paul Boddie) wrote in message news:<23891c90.0201040846.520bc462 at posting.google.com>...
> bragiba at simi.is (Bragi Baldursson) wrote in message news:<abcf4a18.0201040208.2bda19d9 at posting.google.com>...
> > 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?
> 
> The best you can achieve is probably to send content of a certain type
> as a response to a user's HTTP request, resulting in that user's
> browser prompting them to save the document to disk. You would need to
> choose the content type carefully to avoid the browser displaying the
> content in its window, and you might want to set the "content
> disposition" header to suggest a filename to be used when the data is
> saved.
> 
> > Can I also detect the presence of certain files on his hard disk?
> 
> Not unless the users have some kind of plug-in installed which lets
> this happen, or you exploit some security hole in their browsers. :-)
> 
> Certainly, if you want to transparently access files on the users'
> disks then I think you will be disappointed.
> 
> Paul



More information about the Python-list mailing list