cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Back again with another edition of 'How we use Dropbox', so find out how Emma uses to-do lists to get it all done 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

Re: dropbox.api and DropboxClient

Greg-DB
Dropboxer
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.

Re: dropbox.api and DropboxClient

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.

Re: dropbox.api and DropboxClient

Greg-DB
Dropboxer
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.
Poll
We love to learn from the educators who use Dropbox. Whether you teach kids, teens, adults or a combination of all three, we want to know what apps and integrations you use with Dropbox to help with teaching. Which of the ones below is your favorite, or most used tool?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropboxer
  • User avatar
    Lino1 Explorer | Level 3
What do Dropbox user levels mean?
Need more support?