cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more 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: 

Drop-in Saver

Drop-in Saver

A.L
New member | Level 1

Hey guys,

I'm struggling to implement a single drop-in saver button on a blank html document running from local host.
I tried copying the dropins.js and referencing it locally but am unsure what else I could try to get a single upload button working.

my code for reference:

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title> Saver</title>
    </head>
    <body>
        <script type="text/javascript" src="https://www.dropbox.com/static/api/2/dropins.js" id="dropboxjs" data-app-key="kyljf8vcbai3kc7">

        <a href="https://dl.dropboxusercontent.com/s/deroi5nwm6u7gdf/advice.png" class="dropbox-saver"></a>

        Dropbox.createSaveButton(localhost, filename);
        </script>
    </body>
</html>
1 Reply 1

Steve M.
Dropbox Staff

Lots of things about that code look weird. Try this instead:

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>Saver</title>
        <script type="text/javascript" src="https://www.dropbox.com/static/api/2/dropins.js" id="dropboxjs" data-app-key="kyljf8vcbai3kc7"></script>
    </head>
    <body>
        <a href="https://dl.dropboxusercontent.com/s/deroi5nwm6u7gdf/advice.png" class="dropbox-saver">Click here to save.</a>
    </body>
</html>

I changed a few things:

  1. I put the script tag in the head and closed it.
  2. I put some text inside the anchor tag so you could click the link. (I also moved the anchor tag outside of the <script> wrapper so it actually shows up.)
  3. I removed the call to createSaveButton, which referenced two undefined variables (localhost and filename) and didn't do anything with the button anyway.
Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Steve M. Dropbox Staff
What do Dropbox user levels mean?