1

I am trying to allow users to upload large files without tying up my servers for an extended amount of time. I thought using dropbox as file storage might be a good solution. My plan is to use javascript to have the client-side connect directly to dropbox, so that my server is not affected.

I have been trying to find a current javascript dropbox api, but have not had much success. I tried using dropbox-js, but it seems that it is using an outdated version of the API as I get the following error with my current test: {"error": "You're using an older version of the Dropbox API with a new API key. Please use the latest version."}

Does anyone know a fairly simple way to accomplish this task?

2
  • 1
    Unless the Dropbox API structure has changed, you need a developer-secret key to use the API and perform an upload. You can't safely give that key to the client, since it would allow the user free reign to impersonate your app; not to mention that such a release of the secret application key would probably be a violation of Dropbox's developer ToS. What you want to do is probably not possible to achieve securely. (Note that this problem does not diminish the question's general merit, since it's probably still useful to know for server-side JS use cases, like node.js.) Commented Nov 5, 2012 at 16:59
  • That makes sense. I guess there is no secure way to create a connection between the client and the dropbox server to access my dropbox folder. Commented Nov 5, 2012 at 17:02

1 Answer 1

2
  1. Set up your application as a Folder app. If things go wrong, at least you won't blow up people's Dropboxes.

  2. Follow these directions for obfuscating your API key and secret.

  3. Use writeFile to upload the files, and then use makeUrl with the downloadHack: true option, then send the URL to your server.

You'll need the git version of dropbox-js to use downloadHack until the 0.7.0 release comes out.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.