[Zope] Upload files in Zope and store elsewhere

Chris Withers chrisw@nipltd.com
Wed, 22 Mar 2000 11:53:17 +0000


I'd also love to be able to store files uploaded through a Zope form into a MySQL database so if
anyone else has done this successfully, particularly for medium size files (5-6 MB) please can you
let the list know!

cheers,

Chris

Marius Kjeldahl wrote:
> 
> 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
> 
> _______________________________________________
> 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 )