Not getting all keys in FieldStorage (Multipart form data)

Max M maxm at mxm.dk
Thu Jun 5 00:29:32 CEST 2003


Alan Kennedy wrote:

> The CGI "spec" specifies two different mechanisms for providing access to the
> two different types of query data. URI query data, after the "?", should be made
> available in the "QUERY_STRING" environment variable, whereas POSTed or PUT form
> data should be made available on standard input. There is no specification of
> what to do when both forms of data are specified, and therefore no guidance on
> what the cgi.py module should do.
> 
> http://hoohoo.ncsa.uiuc.edu/cgi/env.html
> 
> Best to follow the simple rules stated than try to interpret situations outside
> the explicitly stated rules.


I would also suspect it to have different behaviours with different 
enctypes. The IIS at least acts a bit differently when you try and 
upload files with enctype="multipart/form-data".

You need to read the form as binary data, and once you have done that 
you can no longer get the QUERY_STRING. It simply dissapears.

It would also be a bit of luck if an undefined situation was implemented 
the same way in all browsers and webservers.

-- 

hilsen/regards Max M Rasmussen, Denmark

http://www.futureport.dk/
Fremtiden, videnskab, skeptiscisme og transhumanisme





More information about the Python-list mailing list