INPUT TYPE=file in HTML

Jocelyn Paine popx at pop3.ifs.org.uk
Tue Jul 11 13:41:42 EDT 2000


Hi,

I've been trying to read files uploaded from an HTML <INPUT TYPE=FILE>
field using the CGI module. Are there known problems with this? The
documentation says that if we take the value attribute of the form fields
structure, it returns the entire contents of the file as a string. The
file attribute returns a pointer to the file. But when I try this, I seem
to get the filename as the value attribute, and nothing as the file
attribute.

The field is inside a form whose HTML arguments are just ACTION and
METHOD, nothing else. The field has a TYPE argument whose value is "file",
and a NAME attribute. And this combination of field and form works OK if I
use it to pload a file to a Perl CGI.

Thanks,

Jocelyn Paine
http://www.ifs.org.uk/~popx/
+44 (0)468 534 091 





More information about the Python-list mailing list