I can't upload a file with CGIHTTPServer
Posted
by
sdemingo
on Stack Overflow
See other posts from Stack Overflow
or by sdemingo
Published on 2010-09-12T15:44:54Z
Indexed on
2010/12/25
1:54 UTC
Read the original article
Hit count: 104
Hi all,
I'm using the CGIHTTPServer to implement a simple cgi server. I'm trying to upload a file by a form with the post method and the multipart/form-data enctype but I have problems when I recover the value of the fields in the cgi script.
When the script catch the form fields, the value of the file is a MiniFieldStorage with two fields only (key and file name), and I can't recover the content of the file. As the API doc shows, this content is in value field of a StorageField but in the MiniFieldStorage this field isn't exits.
¿How can I recover a StorageField with the content of the file instead a MiniStorageField? ¿There are other method to upload a file using CGIHTTPServer?
Thanks a lot
© Stack Overflow or respective owner