Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8009811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:33:18+00:00 2026-06-04T18:33:18+00:00

I have a Google Appengine Project using Python2.7 and Django1.2 on Eclipse, that allows

  • 0

I have a Google Appengine Project using Python2.7 and Django1.2 on Eclipse, that allows the user to use a form to upload a picture, resize it, and store it as a BLOB field.

I added a breakpoint where I indicated below, and saw “file[‘content’]” showing a value ” TypeError: ‘InMemoryUploadedFile’ object is not subscriptable” in the Expressions view.

When I step into or over this line, it jumps to the error handler.

Can someone please advise how I can fix this problem? Thanks in advance!

if req.method == 'POST':
    try:
        u_form = UserInfoForm(req.POST)
        if not u_form.is_valid():
            return err_page(_('Error'))

        u = coffeeuser.CoffeeUser.all().filter('user =', user_info).get()
        u.nickname = user_info.nickname()
        u.realname = req.POST.get('real_name')
        u.phone = req.POST.get('phone')
        u.address = req.POST.get('address')
        if req.FILES.get('photo_file'):                
            file = req.FILES.get('photo_file')
            img = images.Image(file['content'])   <<<Breakpoint...Error occurs here
            img.resize(width=50, height=50)
            resized_img = img.execute_transforms(output_encoding=images.JPEG)
            u.photo_file = db.Blob(resized_img)
        u.put()
        return HttpResponseRedirect('/user/')
    except Exception, x:
        return err_page(_('Error'))

And here is the dump of the Console window as this happens. I don’t see any error messages here.

INFO 2012-05-26 07:34:21,114 dev_appserver.py:2891] “GET /favicon.ico HTTP/1.1” 404 –
DEBUG 2012-05-26 07:35:15,960 dev_appserver.py:656] Matched “/user/” to CGI dispatcher with path main.py
DEBUG 2012-05-26 07:35:16,319 dev_appserver_import_hook.py:1246] Enabling PIL: [‘_imaging’, ‘_imagingcms’, ‘_imagingft’, ‘_imagingmath’]
DEBUG 2012-05-26 07:35:16,322 dev_appserver_import_hook.py:1246] Enabling django: []
DEBUG 2012-05-26 07:35:16,322 dev_appserver.py:1624] Executing CGI with env:
{‘HTTP_REFERER’: ‘http://localhost:8080/user/&#8217;, ‘REQUEST_ID_HASH’: ‘C1DFD96E’, ‘SERVER_SOFTWARE’: ‘Development/1.0’, ‘SCRIPT_NAME’: ”, ‘REQUEST_METHOD’: ‘POST’, ‘PATH_INFO’: ‘/user/’, ‘HTTP_ORIGIN’: ‘http://localhost:8080&#8217;, ‘SERVER_PROTOCOL’: ‘HTTP/1.0’, ‘QUERY_STRING’: ”, ‘CONTENT_LENGTH’: ‘927730’, ‘HTTP_ACCEPT_CHARSET’: ‘ISO-8859-1,utf-8;q=0.7,*;q=0.3’, ‘APPENGINE_RUNTIME’: ‘python27’, ‘TZ’: ‘UTC’, ‘HTTP_COOKIE’: ‘RememberMe=YPD/ztDwsHCs3J9cPG5c+g==; dev_appserver_login=”test@example.com:False:185804764220139124118″; sessionid=2b5fc41e4c0332b1161a002ae12e616b; csrftoken=05e24dcb62093082dc1fafe66c0a6dbb’, ‘SERVER_NAME’: ‘localhost’, ‘REMOTE_ADDR’: ‘127.0.0.1’, ‘SDK_VERSION’: ‘1.6.5’, ‘PATH_TRANSLATED’: ‘C:\_dev\eclipse-work\gae\pydev5\src\main.py’, ‘SERVER_PORT’: ‘8080’, ‘CONTENT_TYPE’: ‘multipart/form-data; boundary=—-WebKitFormBoundaryC4BfGc98AzYhJTQD’, ‘CURRENT_VERSION_ID’: ‘1.1’, ‘USER_ORGANIZATION’: ”, ‘USER_ID’: ‘185804764220139124118’, ‘HTTP_USER_AGENT’: ‘Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.168 Safari/535.19’, ‘HTTP_HOST’: ‘localhost:8080’, ‘HTTP_CONNECTION’: ‘keep-alive’, ‘HTTP_CACHE_CONTROL’: ‘max-age=0’, ‘USER_EMAIL’: ‘test@example.com’, ‘HTTP_ACCEPT’: ‘text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8′, ‘APPLICATION_ID’: ‘dev~quizoncloud’, ‘GATEWAY_INTERFACE’: ‘CGI/1.1’, ‘HTTP_ACCEPT_LANGUAGE’: ‘en-US,en;q=0.8’, ‘AUTH_DOMAIN’: ‘gmail.com’, ‘_AH_ENCODED_SCRIPT_NAME’: ‘/user/’}
DEBUG 2012-05-26 07:36:19,815 datastore_stub_index.py:181] No need to update index.yaml

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T18:33:20+00:00Added an answer on June 4, 2026 at 6:33 pm

    file is not a dictionary, so you can’t do key lookup like that. Perhaps you mean file.content?

    Although I don’t think the object has a content attribute either – see the documentation for UploadedFile objects. Maybe you meant file.read()?

    (Also, don’t call your variable file – that hides the built-in file function).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a google-app-engine java project in Eclipse using Google's Eclipse plugin. My
I'm developing a project on Google AppEngine, using Django templates, so I have to
I have created a google appengine project in Eclipse and this project has mixture
I have a Python Facebook project hosted on Google App Engine and use the
Is it possible to have multiple classes that inherit/extends same class in Google AppEngine
I am using Eclipse/PyDev to develop a Google App Engine project called GAEServer. One
I have a Java Google App Engine project which references a class in another
does someone have an idea how to get the environment variables on Google-AppEngine ?
I have google app engine installed to /home/mydev folder such that dev_appserver.py is in
I have a model in Google App Engine that has 50,000+ entities. I would

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.