[Zope] Re: Problems using forms to upload files to Zope
Tres Seaver
tseaver at palladion.com
Tue Nov 15 09:48:46 EST 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Mike Jakowlew wrote:
> Here's what I'm trying to accomplish:
>
> 1. The user fills out a form page with various fields
> 2. The user selects a file to upload
> 3. when the user hits submit two things should happen:
> - The file selected is uploaded
> - all the filled out form fields are written to the database (MS SQL)
>
> This is my current problem:
> The writting to the database part works fine on it's own, but when combined
> with the file upload I get this error
>
> *Error Type: AttributeError*
> *Error Value: 'NoneType' object has no attribute 'headers'*
HTML forms which upload files need to set the 'enctype' attribute of the
form element to 'multipart/formdata', and must use POST rather than GET,
e.g.::
<form method="POST" action="uploadForm.py"
enctype="multipart/formdata">
Tres.
- --
===================================================================
Tres Seaver +1 202-558-7113 tseaver at palladion.com
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFDefVO+gerLs4ltQ4RAo0zAKCPYlJfHriHHMcTnx8sz10YI9aGVACgynu6
Syk9HewjLoBOeowSPvTXl3c=
=hBzv
-----END PGP SIGNATURE-----
More information about the Zope
mailing list