I don't think that the object that I'm grabbing is
a file upload object because I get an AttributeError when I try to access the
'filename' attribute, and when I reference the object name, it return the path
of the uploaded file instead of the actual file. My Zope file then
contains only a string of text that is the path that the user submitted.
There's probably something obvious that I'm not doing, but I've read the
documentation, and that hasn't helped. I'm using Ie6, zope is runnning on
Solaris8. See below for the code and error.
Your help is greatly appreciated,
thanks.
Andrew
The form:
<form action="Upload_FileAction"
method="POST">
<p> Select File to Upload:
<input type="file"
name="uploaded" enctype="multipart/form-data">
</p>
<input type="submit" value="Upload
File">
</p>
</form>
The method:
<dtml-call
"manage_addProduct['OFSP'].manage_addFile(uploaded.filename,uploaded)">
The error log:
Exception traceback
| Time |
2002/11/05 10:16:31.529
US/Eastern |
| User Name (User
Id) |
admin (admin) |
| Request URL |
http://127.0.0.1:8080/Krude/Upload_FileAction |
| Exception
Type |
AttributeError |
| Exception
Value |
filename |
Traceback (innermost last):
- Module ZPublisher.Publish, line 98, in publish
- Module ZPublisher.mapply, line 88, in mapply
- Module ZPublisher.Publish, line 39, in
call_object
- Module OFS.DTMLMethod, line 126, in __call__
- Module DocumentTemplate.DT_String, line 474, in
__call__
- Module DocumentTemplate.DT_Util, line 201, in
eval
__traceback_info__: uploaded
- Module <string>, line 2, in f
AttributeError: filename
form
| uploaded |
'C:\\DATA\\Programming\\Norm & Tom -
php\\test.html' |
cookies
| tree-s |
'eJyLjlZ3hANPW3UdhWiEiHOWq616LBAAAL3mChA' |
| tutorialExamplesURL |
'http://127.0.0.1:8080/Tutorial/examples' |
lazy items
| SESSION |
<bound method
SessionDataManager.getSessionData of <SessionDataManager instance at
bc55a8>> |
other
| AUTHENTICATION_PATH |
'' |
| URL1 |
'http://127.0.0.1:8080/Krude' |
| BASE3 |
'http://127.0.0.1:8080/Krude/Upload_FileAction' |
| URL2 |
'http://127.0.0.1:8080' |
| BASE1 |
'http://127.0.0.1:8080' |
| SERVER_URL |
'http://127.0.0.1:8080' |
| PUBLISHED |
<DTMLMethod instance at
f20d40> |
| URL |
'http://127.0.0.1:8080/Krude/Upload_FileAction' |
| AUTHENTICATED_USER |
admin |
| BASE2 |
'http://127.0.0.1:8080/Krude' |
| TraversalRequestNameStack |
[] |
| uploaded |
'C:\\DATA\\Programming\\Norm & Tom -
php\\test.html' |
| URL0 |
http://127.0.0.1:8080/Krude/Upload_FileAction |
| URL1 |
http://127.0.0.1:8080/Krude |
| URL2 |
http://127.0.0.1:8080 |
| BASE0 |
http://127.0.0.1:8080 |
| BASE1 |
http://127.0.0.1:8080 |
| BASE2 |
http://127.0.0.1:8080/Krude |
| BASE3 |
http://127.0.0.1:8080/Krude/Upload_FileAction |
environ
| HTTP_ACCEPT_ENCODING |
'gzip, deflate' |
| CONTENT_TYPE |
'application/x-www-form-urlencoded' |
| PATH_TRANSLATED |
'/Krude/Upload_FileAction' |
| HTTP_ACCEPT |
'image/gif, image/x-xbitmap, image/jpeg,
image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint,
application/msword, application/x-gsarcade-launch, */*' |
| HTTP_COOKIE |
'tutorialExamplesURL="http://127.0.0.1:8080/Tutorial/examples";
tree-s="eJyLjlZ3hANPW3UdhWiEiHOWq616LBAAAL3mChA"' |
| HTTP_ACCEPT_LANGUAGE |
'en-ca' |
| GATEWAY_INTERFACE |
'CGI/1.1' |
| SERVER_PORT |
'8080' |
| HTTP_USER_AGENT |
'Mozilla/4.0 (compatible; MSIE 6.0; Windows
NT 5.0)' |
| CONTENT_LENGTH |
'67' |
| REMOTE_ADDR |
'192.168.2.10' |
| channel.creation_time |
1036509387 |
| SERVER_PROTOCOL |
'HTTP/1.1' |
| PATH_INFO |
'/Krude/Upload_FileAction' |
| HTTP_HOST |
'127.0.0.1:8080' |
| REQUEST_METHOD |
'POST' |
| SCRIPT_NAME |
'' |
| SERVER_SOFTWARE |
'Zope/(Zope 2.6.0 (binary release, python
2.1, solaris-2.8-sparc), python 2.1.3, sunos5) ZServer/1.1b1' |
| HTTP_CACHE_CONTROL |
'no-cache' |
| CONNECTION_TYPE |
'Keep-Alive' |
| HTTP_REFERER |
'http://127.0.0.1:8080/Krude/Upload_FileForm' |
| SERVER_NAME |
'gratuitous' |