[ZPT] duplicating file upload object

Dieter Maurer dieter at handshake.de
Wed Mar 16 15:49:15 EST 2005


Kenneth Gonsalves wrote at 2005-3-14 10:03 +0530:
>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? 

Position your file again at its start.
You can use its "seek" method for this (documented in the Python
library reference).

-- 
Dieter


More information about the ZPT mailing list