Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
Anton U.
10 years agoNew member | Level 1
Dropbox API - Downloading windows exe file
Well, I'm using .net version of Dropbox V2 API with Visual Basic 2015, and I'm trying with it to download an .exe file from my dropbox. So, I do this:
Dim response = Await dbx.files.BeginDownload(p...
Anton U.
10 years agoNew member | Level 1
@Gregory, no. It's bigger, mostly. Depends on encoding. If I use ASCII enconding, then it's smaller.
@Steve, thanks, your solution worked. Kinda. I'm a little bit rusty with VB, since I didn't use it for a long, long time. In fuction I did responsestream, and later, I had to return stream in class (form1), because file.create apparently doesn't work in async functions.
Below is entire code, so you can see what I did.
Imports System
Imports System.IO
Imports System.Text
Public Class Form1
Dim dropbox As New Dropbox.Api.DropboxClient("My token")
Dim responsestream As Stream
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
GetDbxUser()
GetExe("/my_path", "exefile.exe")
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Using stream = File.Create("exefile.exe")
responsestream.CopyTo(stream)
End Using
End Sub
' Dropbox Api functions
Public Async Function GetDbxUser() As Task
Dim user = Await dropbox.Users.GetCurrentAccountAsync()
'Just to check that it actually works
Label2.Text = "User set complete!"
Label3.Text = user.Email
End Function
Public Async Function GetExe(path As String, file As String) As Task
Dim response = Await dropbox.Files.DownloadAsync(path + "/" + file)
responsestream = Await response.GetContentAsStreamAsync()
End Function
End Class
About 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!