We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
Alexey S.7
11 years agoNew member | Level 1
Help realise download file from Dropbox folder on Visual Basic 2015
I need help in realise downloading file from Dropbox folder on Visual Basic 2015. I found example code only on ASP.NET, but I can`t translate it to Visual Basic code.
async Task Download(DropboxCl...
knight2601
10 years agoExplorer | Level 3
Public Async Function Download(destination As String, file As String) As Task(Of Boolean)
Try
If client Is Nothing Then Await GetAccessToken() ' <- if your client is not defined then define a new client here
Using response = Await client.Files.DownloadAsync("/" + file.Replace("\", "/")).ConfigureAwait(False) ' paths use / seperators,
Dim result = Await response.GetContentAsByteArrayAsync().ConfigureAwait(False) ' wait for download completion
System.IO.File.WriteAllBytes(destination, result) ' write to file system
End Using
Return True
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical, "Error downloading")
Return False
End Try
end functionAbout Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
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, Facebook or Instagram.
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!