Hello My Friends
i need to upload file to my drobpox account by vba with access database
how can i d that ?
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.ServerXMLHTTP60Dim strFile As StringDim Pos1 As IntegerDim Pos2 As IntegerSet req = New MSXML2.ServerXMLHTTP60Dim arg As StringstrFile= ReadBinary(FileName)arg = "{""path"":""/" & FileName & """,""mode"":{"".tag"":""overwrite""},""autorename"":false,""mute"":true}"req.Open "POST", "https://content.dropboxapi.com/2/files/upload", Falsereq.setRequestHeader "Authorization", "Bearer xxxxxxxxxxxxxxxx"req.setRequestHeader "Content-Type", "application/octet-stream"req.setRequestHeader "Content-length", Len(Result)req.setRequestHeader "Dropbox-API-Arg", argreq.setRequestHeader "User-Agent", "api-explorer-client"req.send strFileIf req.Status = 200 ThenDebug.Print req.responseTextElse'MsgBox req.Status & ": " & req.statusTextDebug.Print req.responseTextEnd IfEnd Sub
thanks
i make an access Database
by that Access DB i need to upload report.txt to my Drobpox online folder
how can i do that with Microsoft visual basic 6 VBA
iknow i can download Drobpox app an setup it and i will copy my report .txt to drobpox folder i know that
but i didnt need to do that because i will use My access DB in More PC
so i will not Setup on every PC that Drobpox App
so what can i do
and thanks for your replay
@ElsayedGamal 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.