self.request.get("id") returns a unicode string. You must first make a regular string out of it before casting it to int.
photo = Photo.get_by_id(int(str(self.request.get("id")))) 2009/3/1 wsun <sunwe...@gmail.com>: > > I upload an image to GAE, > > *.py: > photo = Photo.get_by_id(int(self.request.get("id"))) > > *.html: > <input type="file" name="id" id="fileId" /> > > then debug: > ValueError: invalid literal for int() with base 10: '\xff\xd8\xff\xe0' > > How can I fix this error? Thank u. > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appengine@googlegroups.com To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~----------~----~----~----~------~----~------~--~---