[Zope] Upload files in Zope and store elsewhere
Marius Kjeldahl
marius@funcom.com
Wed, 22 Mar 2000 12:43:56 +0100
After some helpful advice, I have been successful in uploading files
(images) to Zope. Now I am trying to stuff the uploaded images in a
MySQL database, but am not able to access the image data.
If I try to stuff the image data "raw" into the database by declaring a
image:string parameter to the ZSQL Method and <dtml-sqlvar image> in
the ZSQL code I get a string like "<ZPublisher.HTTPRequest.FileUpload
instance at 87956214>".
Another approach I have tried was <dtml-var image fmt=sql-quote>, but
this complains about the image being an instance and not a string.
Another approach has been to access the actual "raw" image data using
image.data in various combinations, but I have not gotten this to work
anywhere (contrary to what it seems other people have managed to do),
see this
http://www.egroups.com/group/zope/26227.html?
posting.
Looking through Image.py I see quote a few methods for accessing the
image as a "web" object through the use of URL. Internally, Image.py
uses the data attribute extensively, but I have not been able to access
this from within DTML (and I guess this has to do with data not being
listed in either the properties or permission sections of Image.py).
My final try will probably be to resort to using an External method to
get access to the "full" Image.py object (including data), but I was
hoping to avoid this.
Has anybody done this (uploading in Zope and storing the data outside of
Zope) successfully? If so, please give me a hint..
Thanks,
Marius Kjeldahl