cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to know what we learned at IBC? Check out our learnings on media, remote working and more right here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Save files to dropbox using the save file function

Save files to dropbox using the save file function

Electrify2015
Explorer | Level 4

Hi,

Today i saw this feature that allow a user to just click a button to save the file to the dropbox account. So i was thinking in taking advantage of this feature by creating a page were i just type the direct location on a input field and after pressing the button the file gets transfered.

I have tried diferent techniques after reading the developers documentation but without any luck. there is a problem with file location or it doesn't work.

Any comments or help this

Thanks

14 Replies 14

Electrify2015
Explorer | Level 4
I notice that your share button below my post is similar what i'm trying to achieve but in this case the location is custom for each file i want to transfer to my dropbox account.

Greg-DB
Dropbox Staff
It sounds like you'd be interested in using the Dropbox Saver. You can find the full documentation and instructions for using that here:

https://www.dropbox.com/developers/saver

If that's not working for you, I'll be happy to help, but I'll need some more information. In that case, please reply with:

- the full text of the error/any output
- the relevant code snippet(s)

Electrify2015
Explorer | Level 4
Hi, have tried diferent ways to build it without any luck. All i want is a simple html form that when i click on it the file gets saved in the logged in dropbox account.

I'm getting this error:
{"error": "Invalid origin"}

Do you have a full path to send a get or post request and save the file.

Thanks

Greg-DB
Dropbox Staff
Are you trying to run the Saver from a file:// URL by any chance? That can result in that error.

When using the Chooser or Saver, you'll need to run it from a server, so that Dropbox can verify the domain. (That is, since you need to pre-register the domains you'll user your Chooser or Saver on via the App Console: https://www.dropbox.com/developers/apps )

Try running it from a server instead. (You can even use a localhost server while developing it.)

Electrify2015
Explorer | Level 4

I tried a localhost http server and didn't work either. I did add http://127.0.0.1 and localhost on the app section on the dropbox site.

I get the following error:

{"error": "Origin does not match any app domain"}

 

Greg-DB
Dropbox Staff
The domain for the URL of the page you host the Saver needs to exactly match one of your pre-registered Chooser/Saver domains. (Make sure you don't register an "OAuth 2 redirect URI", as that's not for the Chooser/Saver.)

So, for example, register "localhost" and then access your page from http://localhost (plus whatever port and path you need).

Electrify2015
Explorer | Level 4

This was what i was trying to build but it doesn't work. I get the file value but when executing it! It open the the image.

<form>
<input type="text" id="file_id" value="https://dl.dropboxusercontent.com/s/deroi5nwm6u7gdf/advice.png"><br>
<input type="submit" value="Send!" onclick="send()">
</form>
<script>
send = function() {
var file_id = document.getElementById('file_id').value;
document.write('<a href="'+file_id+'" class="dropbox-saver">123</a>');
}
</script>

Greg-DB
Dropbox Staff
I'm not sure I understand your question. It looks like you already have the Dropbox link at this point in the code though. If you need general HTML/JavaScript help, I'm afraid I can't be of use, as that wouldn't be about Dropbox itself. You may want to post on a general help forum, such as StackOverflow.

Electrify2015
Explorer | Level 4

OK, Thanks

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    sjmasikane New member | Level 2
  • User avatar
    huasa Explorer | Level 3
What do Dropbox user levels mean?