Learn how to make the most out of the Dropbox Community here 💙.
Forum Discussion
ArjitKapoor
7 years agoNew member | Level 2
How to display an image from Dropbox folder to MVC razor view
I am trying to access the Dropbox API and would like to display an image hosted on my dropbox server to display on my razor view My Controller Action: public ActionResult ThreatsOverviewView() ...
Greg-DB
Dropbox Staff
7 years ago[Cross-linking for reference: https://stackoverflow.com/questions/52523055/how-to-display-an-image-from-dropbox-to-mvc-razor-view ]
Using the GetThumbnailAsync method is the right way to get the thumbnail data for an image file. That works the same way as the DownloadAsync method, for which there is an example here:
What you do with the thumbnail data is up to you, depending on what you want your app to do exactly, and how. For example, you may need to save it to the local filesystem to be read later, or you may need to return it directly to some other part of your app.
Also, "RootCauses.png" wouldn't be a valid path. File paths should start with a "/", so it would be something like "/RootCauses.png" or "/FolderName/RootCauses.png", etc. You can also get the path from a file metadata object, using the Metadata.PathLower property.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,966 PostsLatest Activity: 2 days ago
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!