Forum Discussion

Navy's avatar
Navy
Explorer | Level 3
7 years ago

How to fetch image from Dropbox to display on website ?

I base on Meteor Vuejs and Dropbox=4.0.15

I uploaded image to Dropbox using Dropbox API , then I want to get image to display on my website. How can I do ?

dbx
.filesListFolder({ path:path})
.then(function(response) {
console.log(response.entries)
dbx
.filesGetTemporaryLink({
path: response.entries[0].path_lower,
})
.then(function(result) {
this.imgUrl = result
console.log('thum', result)
})
.catch(e => {
console.log(e)
})
})
.catch(function(error) {
console.log(error)
})

Result :

sadly it's not work 

 
  • Dropbox is not intended as a content host for website.  The url you generated via /files/get_temporary_link will for the file to download locally.  It cannot be used to embed content within an HTML tag.  Also, the links generated by /files/get_temporary_link are only functional for four hours, after which they will expire.

    • Navy's avatar
      Navy
      Explorer | Level 3

      Please , recommended way to upload file(Image...) to cloud and fetch data to display on websit.

      • DBX_Robert's avatar
        DBX_Robert
        Icon for Dropbox Staff rankDropbox Staff

        The workflow you are describing, to upload a file to Dropbox and then embed it in a webpage, is not a workflow that is supported by our API.  If you wish to upload file, you can use our /files/upload API, but we do not offer an endpoint or way to embed content directly in webpages.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,941 PostsLatest Activity: 18 hours ago
351 Following

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 or Facebook.

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!