Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
ElsayedGamal
8 years agoExplorer | Level 3
How can i upload file to my Dropbox account with vba ?
Hello My Friends i need to upload file to my drobpox account by vba with access database how can i d that ?
ElsayedGamal
8 years agoExplorer | Level 3
thanks for reply
i need to upload file with code to my online dropbox
i found that code but i need to know how i use
like where i will put my username and passwod of my dropbox account ?
and wher i will put my online drobpox folder Url
and what is my online drobpox folder Url
Public Sub DB_PutFile(FileName As String)
Dim req As MSXML2.ServerXMLHTTP60
Dim strFile As String
Dim Pos1 As Integer
Dim Pos2 As Integer
Set req = New MSXML2.ServerXMLHTTP60
Dim arg As String
strFile= ReadBinary(FileName)
arg = "{""path"":""/" & FileName & """,""mode"":{"".tag"":""overwrite""},""autorename"":false,""mute"":true}"
req.Open "POST", "https://content.dropboxapi.com/2/files/upload", False
req.setRequestHeader "Authorization", "Bearer xxxxxxxxxxxxxxxx"
req.setRequestHeader "Content-Type", "application/octet-stream"
req.setRequestHeader "Content-length", Len(Result)
req.setRequestHeader "Dropbox-API-Arg", arg
req.setRequestHeader "User-Agent", "api-explorer-client"
req.send strFile
If req.Status = 200 Then
Debug.Print req.responseText
Else
'MsgBox req.Status & ": " & req.statusText
Debug.Print req.responseText
End If
End Subthanks
Greg-DB
Dropbox Community Moderator
8 years agoElsayedGamal It sounds like you want to programmatically upload files to your Dropbox account. To do so, you should use the Dropbox API. I see from the code you shared that you already found the correct API endpoint, /2/files/upload, for doing so. (We also have an official .NET SDK that makes this easier, if you can use that in your environment.)
In either case, you don't put your username and password in the code. You authorize the API calls by the use of a Dropbox API OAuth 2 access token. I see you already have code for setting that in the "Authorization" header.
The path where you want the uploaded file to go in your Dropbox is specified by the "path" parameter in the JSON you put in the "Dropbox-API-Arg" header.
For more information on how to use this endpoint, please refer to the /2/files/upload documentation. The API v2 Explorer can also be useful for prototyping these calls.
About Discuss Dropbox Developer & API
Make connections with 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!