[Zope3-Users] z3c.form image upload widget

Martin Aspeli optilude+lists at gmail.com
Fri Mar 6 06:02:03 EST 2009


I'm in need of a z3c.form form that supports image uploads. Ideally, it 
should support optional and mandatory fields, and in 'edit' mode it 
should allow the user to either keep the current image or replace it 
with a new one (Plone/Archetypes has a radio button + a file upload 
widget to achieve this). It'd be nice to also show an icon of filetype 
or small thumbnail of the image next to the widget. Finally, it needs to 
retain the filename that is sent in the request and store this somewhere.

Does anything like this exist? We have collective.namedfile for Zope 2 
and formlib, and we could probably borrow some things from that, but 
it'd be nice if there was something already. Note that for z3c.form on 
Zope 2, with the plone.z3cform library, you get a "wrapper" around the 
form that makes it behave very much like it does in Zope 3. We may need 
a custom data manager for the image, and maybe a custom image IField 
type, but it should be easy enough to re-use most of the stuff across 
Zope 2 and Zope 3.


Author of `Professional Plone Development`, a book for developers who
want to work with Plone. See http://martinaspeli.net/plone-book

More information about the Zope3-users mailing list