File object converted into string ????
Hello again - I am sorry to bother you guys so much today I just get this weird error thing ... a file I'm trying to upload through http is being converted into a string ???? I'm not doing anything unusual ... and the upload code works in another context. I have this form field on a page with a file field ... I browse for a file and hit the submit button. When the code reaches the lines of the upload action I get this error: Error Type: AttributeError Error Value: 'string' object has no attribute 'filename' And the REQUEST object tells me this: file '/home/gitte/405themovie.rm' This should have been a file object :-(( I am not touching the file argument before I try to upload it .. I can't see what is going wrong. Here's a snip from the script that receives the file... <dtml-if "REQUEST.has_key('file')"> <dtml-let masterfileid="id + '_MasterFile'" file_title="title" file_desc="description" file_xsize="xsize" file_ysize="ysize" file_medianet="medianet"> <dtml-call "invokeFactory(id=masterfileid, type_name='Master File')"> <dtml-with "restrictedTraverse(masterfileid)"> <dtml-let filepath="this().absolute_url(relative=1)"> <dtml-call "editFile(REQUEST['file'])"> The last line is the call to the upload function ... So ... can anybody tell me what is going wrong ?? Regards, -- Gitte Wange Jensen Sys Admin, Developer and a lot more MMmanager.org Aps, Denmark Phone: +45 29 72 79 72 Email: gitte@mmmanager.org Web: www.mmmanager.org Quote of the day:
every vote will cause the Data.fs to grow. how do you handle that? Erm yeah it will. Im just taking the Microsoft approach and ignoring it - Andy McKay, 31 Jan 2001
Gitte Wange wrote:
Hello again - I am sorry to bother you guys so much today
I just get this weird error thing ... a file I'm trying to upload through http is being converted into a string ????
I'm not doing anything unusual ... and the upload code works in another context.
I have this form field on a page with a file field ... I browse for a file and hit the submit button.
When the code reaches the lines of the upload action I get this error:
Error Type: AttributeError Error Value: 'string' object has no attribute 'filename'
Be sure the opening form tag looks like this: <form action="...." method="post" enctype="multipart/form-data"> The latter 2 are the key when posting files. hth, -- | Casey Duncan | Kaivo, Inc. | cduncan@kaivo.com `------------------>
On Friday 20 July 2001 17:06, you wrote:
Gitte Wange wrote:
Hello again - I am sorry to bother you guys so much today
I just get this weird error thing ... a file I'm trying to upload through http is being converted into a string ????
I'm not doing anything unusual ... and the upload code works in another context.
I have this form field on a page with a file field ... I browse for a file and hit the submit button.
When the code reaches the lines of the upload action I get this error:
Error Type: AttributeError Error Value: 'string' object has no attribute 'filename'
Be sure the opening form tag looks like this:
<form action="...." method="post" enctype="multipart/form-data">
The latter 2 are the key when posting files.
hth,
THANK YOU :-)))) Thank you so much - I missed the last argument ... DAMMIT I need more coffee :-) Regards, -- Gitte Wange Jensen Sys Admin, Developer and a lot more MMmanager.org Aps, Denmark Phone: +45 29 72 79 72 Email: gitte@mmmanager.org Web: www.mmmanager.org Quote of the day: | > Normally, I would tell you to visit; | > | > http://www.zope.org/Documentation/ | > | > but, some monkey has designed the interface w/o actually testing it, | > since there's no direct references to the online ZSQL Reference there | > any more, and the online dtml reference shoves you into dtml-var. | | Monkey fix! bannana? No banana for you! Bad Monkey! And stop breathing into the female monkey cages... - Andrew K Milton to Mindlace, Jan 17, 2001. zope list
participants (2)
-
Casey Duncan -
Gitte Wange