We Want to Hear From You! What Do You Want to See on the Community? Tell us here!
Forum Discussion
Lino1
8 years agoExplorer | Level 3
dropbox.api and DropboxClient
I have these few lines of code in my ASP.net app to get files from DropBox.
And I get no error but it DOES NOT WORK? nothing happens. This code is in an Async function
an it does get invoked correctly, etc, etc. Folders are correct. App in DropBox is correct. My Token is correct. Any help would be much appreciated. Thank you.
Dim myDbClient As New DropboxClient("MyToken")
myDbClient.Files.DownloadAsync("/" + folder + "/" + fileName).ConfigureAwait(False)
Dim folder = "Mike_Lino_Taxi_App" 'dropbox folder name
Dim fileName = "lino123A.txt" 'dropbox file name
response = Await myDbClient.Files.DownloadAsync("/" + folder + "/" + fileName).ConfigureAwait(False)
Dim bytes = Await response.GetContentAsByteArrayAsync().ConfigureAwait(False)
Using fileStream = File.Create("C:\Projects\Mike\lino777.txt") ' local path
fileStream.Write(bytes, 0, bytes.Length)
End Using
3 Replies
- Greg-DB8 years ago
Dropbox Community Moderator
I don't see anything obviously wrong. Please step through this code with a debugger and figure out which exact line doesn’t work as expected and share the details. - Lino18 years agoExplorer | Level 3
Thank you for your response Greg.
This is the line that fails:
Dim response As IDownloadResponse(Of FileMetadata) = Await myDbClient.Files.DownloadAsync("/" + folder + "/" + fileName)
I have a Try Catch in my code and error is: "An error occurred when send the request."
This error message is too general. I checked all my folders, names, etc. All looks good.
any help would be appreciated. Is there any way of getting more details about this error. Can I get some trace log or something?
Thanks again.
- Greg-DB8 years ago
Dropbox Community Moderator
If the Dropbox API call is failing, you should get a more specific error from the API. It sounds like you're only retrieving a generic error message though. Please inspect the exception, e.g., using the debugger, to get more information.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.6,036 PostsLatest Activity: 2 days ago
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 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!