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 8737559
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:33:06+00:00 2026-06-13T10:33:06+00:00

Trying to upload to my local host. Here’s the HTML bit: <form enctype=multipart/form-data method=POST

  • 0

Trying to upload to my local host. Here’s the HTML bit:

<form enctype="multipart/form-data" method="POST" action="http://localhost:8080/_ah/upload/ahRkZXZ-ZGV2LWN5YmVyc2NpZW5jZXIbCxIVX19CbG9iVXBsb2FkU2Vzc2lvbl9fGAsM"><input type="file" name="srcFile"><input type="submit" value="submit" name="submit"></form>

Here are headers:

Response Headers:

Cache-Control   no-cache
Content-Length  0
Content-Type    text/html
Date    Fri, 26 Oct 2012 19:19:56 GMT
Expires Fri, 01 Jan 1990 00:00:00 GMT
Server  Development/1.0

Request Headers:

Accept  text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding gzip, deflate
Accept-Language en-US,en;q=0.5
Connection  keep-alive
Cookie  __utma=111872281.1477928994.1342991890.1351271332.1351275008.45; __utmz=111872281.1342991890.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); dev_appserver_login="me@gmail.com:False:[[int]]"; __utmc=111872281; __utmb=111872281.13.10.1351275008
Host    localhost:8080
Referer http://localhost:8080/diagnostics
User-Agent  Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:16.0) Gecko/20100101 Firefox/16.0

Request Headers From Upload Stream:

Content-Length  451
Content-Type    multipart/form-data; boundary=---------------------------19073888353745436471437703342

Here’s how I handle the request in project/__init__.py:

 76     config.add_route('UHandler', '/uploads/test')
 77     config.add_view(UploadHandler,
 78                     attr="post",
 79                     route_name='UHandler',
 80                     context=Root,
 81                     renderer='uploads.jinja2')

here’s the handler code it hits:

   class UploadHandler(blobstore_handlers.BlobstoreUploadHandler):
       def post(self):
           pdb.set_trace()

In the debugger I run:

(Pdb) p self.get_uploads()
*** AttributeError: AttributeError("'Root' object has no attribute 'params'",)
(Pdb) p self
<cyberanatomy.view.uploads.UploadHandler object at 0x5130ad0>
(Pdb) p self.get_uploads('srcFile')
[]
(Pdb) p self.get_uploads('srcFile')[0]
*** IndexError: IndexError('list index out of range',)
(Pdb) dir(self)
['_BlobstoreUploadHandler__uploads', '__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'abort', 'app', 'dispatch', 'error', 'get_uploads', 'handle_exception', 'initialize', 'post', 'redirect', 'redirect_to', 'request', 'response', 'uri_for', 'url_for']
(Pdb) self.request.request.POST
MultiDict([(u'srcFile', FieldStorage(u'srcFile', u'Screen Shot 2012-09-21 at 12.47.19.png')), (u'submit', u'submit')]
(Pdb) p self.get_uploads('anyRandomString')
[]

Moving my breakpoint inside the get_uploads function:
google_appengine/google/appengine/ext/webapp/blobstore_handlers.py

(Pdb) dir(self.request.params)
*** AttributeError: 'Root' object has no attribute 'params'
(Pdb) dir(self.request.request.params)
['_MutableMapping__marker', '__abstractmethods__', '__class__', '__contains__', '__delattr__', '__delitem__', '__dict__', '__doc__', '__eq__', '__format__', '__getattribute__', '__getitem__', '__hash__', '__init__', '__iter__', '__len__', '__metaclass__', '__module__', '__ne__', '__new__', '__nonzero__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__setitem__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_abc_cache', '_abc_negative_cache', '_abc_negative_cache_version', '_abc_registry', '_readonly', 'add', 'clear', 'copy', 'dict_of_lists', 'dicts', 'extend', 'from_fieldstorage', 'get', 'getall', 'getone', 'has_key', 'items', 'iteritems', 'iterkeys', 'itervalues', 'keys', 'mixed', 'pop', 'popitem', 'setdefault', 'update', 'values', 'view_list']

so, changing line 372 there from:

372       for key, value in self.request.params.items():

to:

372       for key, value in self.request.request.params.items():

results in:

(Pdb) print self.get_uploads()
[<google.appengine.ext.blobstore.blobstore.BlobInfo object at 0x4a6eb50>]
(Pdb) self.get_uploads()[0]
<google.appengine.ext.blobstore.blobstore.BlobInfo object at 0x4a6eb50>

What’s going on? Is this an issue with the content type in the header? Is this an issue with how pyramid is processing the request in project/__init__.py? Is this a bug in appengine?

  • 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-13T10:33:07+00:00Added an answer on June 13, 2026 at 10:33 am

    Well I have no idea what your BlobStoreUploadHandler base class is doing, but it appears as if it has set self.request as your context, considering that self.request.params is returning AttributeError: 'Root' object has no attribute 'params' and your view is configured to match a context of type Root.

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

Sidebar

Related Questions

I'm trying to upload some records to my local data store using appcfg.py Only
I'm trying to upload a file via FTP from my local computer to an
I'm trying to test a rest api for upload a local file to a
I'm trying to use heroku db:push to upload my local postgresql database to the
I'm trying to resume an upload using indy (HTTP Post), the code looks like
I'm trying to post multipart content (a file and some strings) to a Sinatra
I'm trying to use a html file input tag to upload videos to a
I'm trying to upload images to a php file, everything works, but sometimes when
I'm trying to upload a rails app to dotcloud. I'm getting this error: PG::Error
I am trying to upload an updated version of my application (.apk) in google

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.