[mod_python] Potential bug with util.py or mpservlet and upload

Daniel Popowich dpopowich at comcast.net
Sun Sep 5 21:59:37 EDT 2004


Vinj Vinj writes:
> I get the following error when I try to upload a form
> which has two files. I get this exception when I have
> a file upload and the file upload variables are
> specified in the query_vars or fields.

You CANNOT use query_vars for file uploads.  As the documentation
states, you can only use query_vars to create instance variables of
type string, list or dict.

Of course, query_vars SHOULD support file types for uploads and it's
on my to-do list for a future release.  In the meantime you can mimic
it by using:

    self.UPLOAD = self.form.getfirst(UPLOAD)

where UPLOAD is the string value you gave the NAME attribute of the
INPUT tag.

Daniel Popowich
-----------------------------------------------
http://home.comcast.net/~d.popowich/mpservlets/



More information about the Mod_python mailing list