Hi all, How can I upload an image through Python script(external method also ok) in zope, with out using any html form... ie) I have a file in my servers folder.... Just I want to add this to zope... I dont have any html form to browse file.... hope somebody will help me bi from saravanan annamalai _______________________________________________________________________ Odomos - the only mosquito protection outside 4 walls - Click here to know more! http://r.rediff.com/r?http://clients.rediff.com/odomos/Odomos.htm&&odomos&&w...
If I understand you correctly, you have some image files on your server that you want to load in as Zope objects, but since they're on the server you aren't able to use HTTP upload to do it. If that's the case, check out: http://www.zope.org/Members/camil7/bulk_image_upload It was written to solve a slightly different problem, but should do the trick. HTH, Dylan On Thu, 2003-04-03 at 06:48, saravanan annamalai wrote:
Hi all, How can I upload an image through Python script(external method also ok) in zope, with out using any html form...
ie) I have a file in my servers folder.... Just I want to add this to zope... I dont have any html form to browse file....
hope somebody will help me
bi from saravanan annamalai _______________________________________________________________________ Odomos - the only mosquito protection outside 4 walls - Click here to know more! http://r.rediff.com/r?http://clients.rediff.com/odomos/Odomos.htm&&odomos&&w...
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
At 14.48 03/04/2003 +0000, you wrote:
Hi all, How can I upload an image through Python script(external method also ok) in zope, with out using any html form...
ie) I have a file in my servers folder.... Just I want to add this to zope... I dont have any html form to browse file....
hope somebody will help me bi from saravanan annamalai
Hy, I just solved this problem some days ago BUT for a text file (but this is not problem in my opinion). The code for ExternalMethod is: #Load a file from Server FSO in Zope without using form def main(self, fileName): #Directory on FSO that contains yhe image to upoload myDir='C:\\temp\\' #Read file from directory (please try use 'r' vs.'rb' to NOT read in binary mode) f = open(myDir+fileName, 'rb') data = f.read() f.close() del f #Set the folder (''testZopeFolder') in which I want upload the file (from the context of ExternalMethod) obj=self.restrictedTraverse('testZopeFolder/') #File upload (please note to set the content-type property) obj.manage_addFile('fileID',data, content_type=''set the content-type...img/...') del data return true OK? Write me if you have some problems... Bye, Mau ps: a special thanks to Michele Zanotti!
participants (3)
-
Dylan Reinhardt -
Maurizio Betti -
saravanan annamalai