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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T07:41:10+00:00 2026-06-02T07:41:10+00:00

I am trying to create files in a Dropbox.com folder from a GAE application.

  • 0

I am trying to create files in a Dropbox.com folder from a GAE application.
I have done all the steps the register a Dropbox application and installed the Python SDK from Dropbox locally on my development machine. (see dropbox.com API).
It all works perfectly when I use the cli_client.py test script in the dropbox SDK on my local machine to access dropbox – can ‘put’ files etc.

I now want to start working in GAE environment, so things get a bit tricky.
Some help would be useful.

For those familiar with the Dropbox API code, I had the following issues thus far:

Issue 1

The rest.py Dropbox API module uses pkg_resources to get the certs installed in site-packages of a local machine installation.
I replaced

TRUSTED_CERT_FILE = pkg_resources.resource_filename(__name__, 'trusted-certs.crt')

with

TRUSTED_CERT_FILE = file('trusted-certs.crt')

and placed the cert file in my GAE application directory. Perhaps this is not quite right; see my authentication error code below.

Issue 2

The session.py Dropbox API module uses oauth module, so I changed the include to appengine oauth.

But raised an exception that GAE’s oauth does not have OAuthConsumer method used by the Dropbox session.py module. So i downloaded oauth 1.0 and added to my application an now import this instead of GAE oauth.

Issue 3

GAE ssl module does not seem to have CERT_REQUIRED property.

This is a constant, so I changed

self.cert_reqs = ssl.CERT_REQUIRED

to

self.cert_reqs = 2

This is used when calling

ssl.wrap_socket(sock, cert_reqs=self.cert_reqs, ca_certs=self.ca_certs)

Authentication Error

But I still can’t connect to Dropbox:

Status: 401
Reason: Unauthorized
Body: {"error": "Authentication failed"}
Headers: [('date', 'Sun, 19 Feb 2012 15:11:12 GMT'), ('transfer-encoding', 'chunked'), ('connection', 'keep-alive'), ('content-type', 'application/json'), ('server', 'dbws')]
  • 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-02T07:41:12+00:00Added an answer on June 2, 2026 at 7:41 am

    Here’s my patched version of Dropbox Python SDK 1.4 which works well for me with Python 2.7 GAE: dropbox_python_sdk_gae_patched.7z.base64. No extra third-party libraries needed, only those provided by GAE environment.

    Only file uploading (put_file) is tested. Here’re setup steps:

    1. Unpack archive to the root folder of GAE application (if main app is in the root folder). You can decode BASE64 using Base64 Encoder/Decoder: base64.exe -d dropbox_python_sdk_gae_patched.7z.base64 dropbox_python_sdk_gae_patched.7z.
    2. Setup APP_KEY, APP_SECRET, ACCESS_TYPE, ACCESS_TOKEN_KEY, ACCESS_TOKEN_SECRET. First three are configured at dropbox application creation time. Last two are obtained when granting application access to specific dropbox account, you can get them through cli_client.py (from DB Python SDK) from token_store.txt file.
    3. Use in the code like this:

      import dropbox
      # ...
      def DropboxUpload(path, data):
          sess = dropbox.session.DropboxSession(APP_KEY, APP_SECRET, ACCESS_TYPE)
          sess.set_token(ACCESS_TOKEN_KEY, ACCESS_TOKEN_SECRET)
          cli = dropbox.client.DropboxClient(sess)
          data_file = StringIO.StringIO(data)
          return cli.put_file(path, data_file)
      # ...
      import json
      class DropboxUploadHandlerExample(webapp2.RequestHandler):
          def get(self):
              url = "http://www.google.com/"
              result = urlfetch.fetch(url)
              self.response.headers['Content-Type'] = 'application/json'
              self.response.out.write(json.dumps(DropboxUpload('/fetch_result.dat', result.content)))
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a simple Spring 3 application and have the following files.
Have you ever used lazy C++? I am trying to create .CPP files out
I'm trying to create a utility class for traversing all the files in a
I'm trying to create a cron job which will automatically delete .jpg files from
I am trying to create a regex that will take all files that do
I am trying to create a Javascript function that will return all javascript files
I'm trying to create a Webapp which can read the user's Dropbox files. If
I'm trying to create a function to create csv files from queries. After I
I am trying to create 100 files using FileOutputStream/BufferedOutputStream. I can see the CPU
I'm trying to create proper header files which don't include too many other files

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.