Hi there The Python Method (not external Python Method!) below must upload an image after being given the id, title and filename (on the client computer). This should work the same way as the management interface based image uploading. Somehow, this function causes the image to be created, but is seems to contain no image data (you cannot view the image). What am I doing wrong? (self is passed as the only parameter. id, title and file are set in the calling form) id = self.REQUEST['id'] title = self.REQUEST['title'] file = self.REQUEST['file'] self.manage_addProduct['OFSP'].manage_addImage(id,file,title) return "Your image is uploaded."
Do you have enctype="multipart/form-data" ??? ----- Original Message ----- From: "Etienne Labuschagne" <etiennel@geospace.co.za> To: "Zope user list (E-mail)" <zope@zope.org> Sent: Friday, May 04, 2001 9:32 AM Subject: [Zope] Uploading images - no image!
Hi there
The Python Method (not external Python Method!) below must upload an image after being given the id, title and filename (on the client computer). This should work the same way as the management interface based image uploading. Somehow, this function causes the image to be created, but is seems to contain no image data (you cannot view the image). What am I doing wrong?
(self is passed as the only parameter. id, title and file are set in the calling form)
id = self.REQUEST['id'] title = self.REQUEST['title'] file = self.REQUEST['file']
self.manage_addProduct['OFSP'].manage_addImage(id,file,title)
return "Your image is uploaded."
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Make sure your form is declared like this: <form name="Form_name" action="your_method" method="Post" ENCTYPE="multipart/form-data"> The part that says ENCTYPE="multipart/form-data" is the essential part for upload applications. -- Loren
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Etienne Labuschagne Sent: Friday, May 04, 2001 00:32 To: Zope user list (E-mail) Subject: [Zope] Uploading images - no image!
Hi there
The Python Method (not external Python Method!) below must upload an image after being given the id, title and filename (on the client computer). This should work the same way as the management interface based image uploading. Somehow, this function causes the image to be created, but is seems to contain no image data (you cannot view the image). What am I doing wrong?
(self is passed as the only parameter. id, title and file are set in the calling form)
id = self.REQUEST['id'] title = self.REQUEST['title'] file = self.REQUEST['file']
self.manage_addProduct['OFSP'].manage_addImage(id,file,title)
return "Your image is uploaded."
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (3)
-
Etienne Labuschagne -
Loren Stafford -
Peter Bengtsson