Mike Jakowlew schrieb:
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'*

My code:

*********HTML FORM**********
<h1 tal:content="template/title">title</h1>
<p>Fill out the form below to update the website with the appropriate info:</p>

<form action="uploadForm.py">

                              ^^^^ here is the problem
You need enctype="multipart/form-data"
compare it with filelibrary example or the ZMI
fileupload which basically does the same.

<table width="100%"  border="0" cellspacing="0" cellpadding="0">
<td width="16%" height="27" align="right"><strong>Your Dept: </strong></td>
    <td width="84%"><input type="text" name="department"></td>
... *snip* ---

Zope maillist  -  Zope@zope.org
**   No cross posts or HTML encoding!  **
(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to