I'm trying to resize an image uploaded from a form using PIL. I got it to work on an existing image but I can't seem to get it to work on an image that's uploaded through the form. The ID of the file I'm trying to upload is "DSCF0004.jpg". The form, script and traceback are listed below. Thanks in advance.

<form action="processed/imgSizer" method="post" enctype="multipart.form-data"> <input type="file" name="original_id"> <input type="submit" name="submit" value=" Add ">

(imgSizer External Method)
1 def makeImages(self, original_id):
2 3 import PIL.Image
4    import PIL
5    from StringIO import StringIO
6    import os.path
8    original_image=getattr(self, original_id)
9    original_file=StringIO(str(original_image.data))


Traceback (innermost last):

   * Module ZPublisher.Publish, line 115, in publish
   * Module ZPublisher.mapply, line 88, in mapply
   * Module ZPublisher.Publish, line 41, in call_object
   * Module Products.ExternalMethod.ExternalMethod, line 225, in __call__
     __traceback_info__: ((<Folder at /dev/imgtest/processed>,
     'DSCF0004.jpg'), {}, None)
   * Module .../Zope/Extensions/imgSizer.py, line 9, in makeImages

AttributeError: DSCF0004.jpg

Zope maillist  -  Zope@zope.org
**   No cross posts or HTML encoding!  **
(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to