cgi type=file problems

Dag dag at animagicnet.no
Mon Sep 3 14:46:18 EDT 2001


> On 3 Sep 2001, Dag wrote:
> D> I have a HTML form with a type=file input element and I simply want to
> D> get the file name as a string.  I'm not interested in the actual file.
> D> However the value from the file part of the form doesn't seem to get
> D> passed at all.
> D> For example I have the following form and script;
> D>
> D> <form action="/cgi-bin/cgi-test.py" method="post">
>
> <form action="/cgi-bin/cgi-test.py" method="post"
enctype="multipart/form-data">

Thanks, but unfortunately this doesn't quite seem to work the way I want it
to.  adding enctype="multipart/form-data" seems to makes the script upload
the entire file, which is something I want to avoid, since I only need the
filename and just want to use the file browsing to simplify entering the
data, and make sure no typos are made.  Copying several megs across the
network to simply extract a 50 byte string seems a bit of a waste.

Dag





More information about the Python-list mailing list