[ZPT] duplicating file upload object

robert robert at redcor.ch
Mon Mar 14 00:35:55 EST 2005


Kenneth Gonsalves wrote:

>hi,
>i have a form which, among other things has a 'file' type input to 
>upload an image. The image is then escaped and stored in a 
>postrgresql database. At the same time, i want to make a thumbnail of 
>the image and store that also in the database. I have an external 
>script python that takes the input from the file upload object and 
>returns the escaped image and the escaped thumbnail. Only it doesn 
>work because when the image is retrieved and escaped, the file upload 
>object vanishes and there is no input for the thumbnail creating 
>function. How do i get around this? 
>  
>
you must not take the input but the file object itself.
look in  YourZope/lib/python/OFS/Image.py
There is a manage_upload method that should help you making things  clearer.
robert


More information about the ZPT mailing list