Google App Engine Python: get image upload size server-side

Posted by goggin13 on Stack Overflow See other posts from Stack Overflow or by goggin13
Published on 2010-05-14T03:42:43Z Indexed on 2010/05/14 3:54 UTC
Read the original article Hit count: 338

I am building a Google App Engine App that lets users upload images; I have everything working fine, but I am struggling to find a way to ensure that the user does not upload an image too large (because I am resizing the images, so this crashes my python script). When a user uploads a large image, I get this error

RequestTooLargeError: The request to API call images.Transform() was too large.

I know that there is a size limitation on what GAE allows for it's image API, I am just trying to find a way to deal with this server side; something along the lines of

if (image is too large):
    inform user
else:
    proceed

I haven't had any luck finding the right python code to do this; can anyone help me out?

© Stack Overflow or respective owner

Related posts about google-app-engine

Related posts about python