Need to see if your shared folder is taking up space on your dropbox 👨‍💻? Find out how to check here.

Forum Discussion

Sjoerd's avatar
Sjoerd
Explorer | Level 4
8 years ago
Solved

Embedding images without sharing for just the using signed in (trying to build an app)

Hi, I'm trying to build an app to sort images. Mostly focused on holiday images. Since I have these spread through my Dropbox(phone camera uploads, dslr saved to a seperate Dropbox folder, shares fr...
  • Greg-DB's avatar
    8 years ago

    Using the temporary links returned by /2/files/get_temporary_link would be the closest thing to what you're looking for. I believe that should technically work for embedding images, e.g., using the link the 'src' for an <img> tag. In what way did that not work?

    An alternative would be to make the API calls in JavaScript directly from the browser, e.g., using the API v2 JavaScript SDK, to avoid sending it through your server. That would look something like this:

    dbx.filesDownload({path: '/test.jpg'})
      .then(function(response) {
        var blobUrl = URL.createObjectURL(response.fileBlob);
        var img = document.createElement('img');
        img.setAttribute('src', blobUrl);
        document.getElementById('results').appendChild(img);
      })
      .catch(function(error) {
        console.error(error);
      });

    I'll also send this along as a feature request for a better way to do this via the server though. 

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!