Re: duplicating file upload object

Dieter Maurer <[email protected]>
Newsgroups gmane.comp.web.zope.page-templates
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.