Validate image with IS_IMAGE()

17 views
Skip to first unread message

Christian Varas

unread,
May 9, 2019, 10:09:51 PM5/9/19
to web...@googlegroups.com
Hello guys, I'm trying to validate and save and image from FieldStorage() of ckeditor (not from the web2py slices)

i'm using the validor IS_IMAGE() like this
IS_IMAGE()(request.vars['upload'].value)

I'm getting the following "invalid image" message.

('\x89PNG\r\n\x01\x11\x10\x81\xad\x04d\xd8le\xa1=\x11\x1\***sniped****ab\xe3\x04So\xe8K~\x00\x00\x00\x00IEND\xaeB`\x82', 'Invalid image')

Do i need to decode/scape the string  or something to make it work?

I'm a bit lost at this point...

Cheers.
Chris.
Reply all
Reply to author
Forward
0 new messages