cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
We just wanted to say thank you! Check out our customer appreciation video 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: 

dropbox.api and DropboxClient

dropbox.api and DropboxClient

Lino1
Explorer | Level 3

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 3

Greg-DB
Dropbox Staff
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.

Lino1
Explorer | 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-DB
Dropbox Staff
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.
Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Lino1 Explorer | Level 3
What do Dropbox user levels mean?