cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Are you interested in learning how media industry leaders use Dropbox Replay? Register for our webinar 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: 

Saver does not upload image file to dropbox, only opens the image in new tab.

Saver does not upload image file to dropbox, only opens the image in new tab.

dwWithCat
Explorer | Level 3
Go to solution

Trying to use Saver on Instagram files. If I use the API like this:

 

 

 

fetch("/api/dropboxupload", {
        method: "POST",
        headers: {
          "Content-Type": "application/json",
        },
        body: JSON.stringify({
          url: YOUR_FILE_URL,
          filename: YOUR_FILE_NAME,
          accessToken: accessToken.DropboxToken,
        }),
      })

 

 

 

I am successful. If I uninstall Dropbox from my node app and use Saver like this:

 

 

 

      <a
        href={YOUR_FILE_URL}
        data-filename={YOUR_FILE_NAME}
        className="dropbox-saver dropbox-dropin-btn dropbox-dropin-default"
      >
        Save to Dropbox2
      </a>

 

 

 

All that happens is that the image opens in a new tab in the browser.

 

Popups are allowed in both Safari and Chrome for dropbox.com.

 

 

 

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

@dwWithCat Здравко is correct; for a situation like that, you'll need to instead follow "Programmatically creating Saver buttons" or "Triggering the Saver from JavaScript".

View solution in original post

12 Replies 12

Greg-DB
Dropbox Staff
Go to solution

Your first code snippet shows you POSTing some information to your server, not directly to the Dropbox API, so it's unclear what that does. Presumably you then have code that calls the /2/files/save_url Dropbox API endpoint. That offers essentially the same functionality as the Dropbox Saver, but using a different interface.

 

For your second code snippet, where you're trying to use the Dropbox Saver, I see you're setting an attribute "className" but that should actually be "class" as documented here. By the way, you shouldn't set "dropbox-dropin-btn" and "dropbox-dropin-default" yourself; the Dropbox Saver script will do that automatically.

 

Also, make sure you have the script tag loaded as covered in the Setup section of the documentation.

dwWithCat
Explorer | Level 3
Go to solution
The first snippet succeeds. It’s code from my api Endpoint. The second snippet is my Saver anchor tag with the same data as in the first snippet. The url is a link to an Instagram image. The only difference that I can see between the data in the two snippets is the access token in the api method

dwWithCat
Explorer | Level 3
Go to solution
Gemini AI said that Saver won’t upload an image file from a url, that it has to be a file located on my machine

Здравко
Legendary | Level 20
Go to solution

Hi @dwWithCat,

Dropbox Saver can do different things (data as a nature). Not everything is fully documented but you can see an example here. There you can see how different types of data may be handled by Dropbox Saver. 😉

Good luck.

Greg-DB
Dropbox Staff
Go to solution

@dwWithCat In order to successfully use the Saver, make sure you're configuring the attributes, etc. as documented. Please refer to my previous message for a few specifics to check to make sure you configure this correctly.

 

Also, the Saver does support uploading image files from URLs.

dwWithCat
Explorer | Level 3
Go to solution

This is the html for my button:

<a href="https://scontent-bos5-1.cdninstagram.com/v/t51.29350-15/428411950_339418955083101_368199220363993675_n.jpg?_nc_cat=102&amp;ccb=1-7&amp;_nc_sid=18de74&amp;_nc_ohc=0ce-NRUUU5sQ7kNvgEM71DQ&amp;_nc_ht=scontent-bos5-1.cdninstagram.com&amp;edm=ANo9K5cEAAAA&amp;oh=00_AYArNjV13Xrqx0ES6GTEp2oGvbNtOkDp5MpdqcaCz1ur0A&amp;oe=66514ADB" data-filename="_everything_in_my_feed_begins_with_g__.jpg" class="dropbox-saver dropbox-dropin-btn dropbox-dropin-default">Save to Dropbox2</a>

clicking on this button only opens a new tab and displays the image. It does not upload the file to Dropbox

dwWithCat
Explorer | Level 3
Go to solution

This is in the head tag:

<script type="text/javascript" src="https://www.dropbox.com/static/api/2/dropins.js" id="dropboxjs" data-app-key="erwx9osh8i78x25"></script>

dwWithCat
Explorer | Level 3
Go to solution

use this button: 

<a href="https://scontent-bos5-1.cdninstagram.com/v/t51.29350-15/428411950_339418955083101_368199220363993675_n.jpg?_nc_cat=102&amp;ccb=1-7&amp;_nc_sid=18de74&amp;_nc_ohc=0ce-NRUUU5sQ7kNvgEM71DQ&amp;_nc_ht=scontent-bos5-1.cdninstagram.com&amp;edm=ANo9K5cEAAAA&amp;oh=00_AYArNjV13Xrqx0ES6GTEp2oGvbNtOkDp5MpdqcaCz1ur0A&amp;oe=66514ADB" data-filename="_everything_in_my_feed_begins_with_g__.jpg" class="dropbox-saver dropbox-dropin-btn dropbox-dropin-default">Save to Dropbox2</a>

the other one expired.

Greg-DB
Dropbox Staff
Go to solution

@dwWithCat I just tried this and the Saver button was successfully built and clicking it successfully launched the Saver, not a new tab showing the image:

<!DOCTYPE html>
<html>

	<head>

		<script type="text/javascript" src="https://www.dropbox.com/static/api/2/dropins.js" id="dropboxjs" data-app-key="erwx9osh8i78x25"></script>

	</head>

	<body>

		<a href="https://scontent-bos5-1.cdninstagram.com/v/t51.29350-15/428411950_339418955083101_368199220363993675_n.jpg?_nc_cat=102&amp;ccb=1-7&amp;_nc_sid=18de74&amp;_nc_ohc=0ce-NRUUU5sQ7kNvgEM71DQ&amp;_nc_ht=scontent-bos5-1.cdninstagram.com&amp;edm=ANo9K5cEAAAA&amp;oh=00_AYArNjV13Xrqx0ES6GTEp2oGvbNtOkDp5MpdqcaCz1ur0A&amp;oe=66514ADB" data-filename="_everything_in_my_feed_begins_with_g__.jpg" class="dropbox-saver dropbox-dropin-btn dropbox-dropin-default">Save to Dropbox2</a>

	</body>

</html>

 

If this isn't working for you, please share a live sample page URL displaying the issue so we can take a look.

 

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Здравко Legendary | Level 20
  • User avatar
    dwWithCat Explorer | Level 3
What do Dropbox user levels mean?