eu uso o exemplo desse link
https://www.maximoaccess.com/t29327-exemplo-download-direto-download-direto-dropbox
gostaria de sabe se ao inves de baixar tem como fazer q ele envia pra mesma pasta do dropbox via codigo como esse ai de baixar
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 Sub
Public Function Upload()
Dim arg As String
access_token = "y8bHalvyny8AAAAAAAAAAV-HCCOWhYi3pQYEm2b1Cup6d4WDyARp6WcRPviEED6C"
result = FRB(CurrentProject.Path & "\C_41823022000139.dll")
varfile = "\/TU_DIRECTORIO_EN_DRPBOX\/NOMBRE_Y_EXTENSION_FINAL_DEL_ARCHIVO_EN_DROPBOX"
arg = "{""path"":""" & varfile & """,""mode"":""add"",""autorename"":false,""mute"":true}"
Set req = CreateObject("WINHTTP.WinHTTPRequest.5.1")
req.Open "POST", "https://content.dropboxapi.com/2/files/upload", False
req.setRequestHeader "Authorization", "Bearer " & access_token 'Hay que poner el token de la aplicacion de dropbox en la variable
req.setRequestHeader "Content-Type", "application/octet-stream"
req.setRequestHeader "Dropbox-API-Arg", arg
req.setRequestHeader "User-Agent", "api-explorer-client"
req.Send (result)
If req.Status = 200 Then
Debug.Print req.responseText
Else
Debug.Print req.responseText
End If
End Function
Public Function ExUpload()
Parametros_de_Long "EmpLong.jas"
Dim access_token As String
Dim req As Object
TokenEnviado = ""
DirExtensao = XCodLong & "Combustivel.env"
Set req = CreateObject("WINHTTP.WinHTTPRequest.5.1")
arg = "{""path"":""/Enviado/" & DirExtensao & " \}"
req.Open "POST", "https://api.dropboxapi.com/2/files/delete_v2 \"
req.setRequestHeader "Authorization", "Bearer " & TokenEnviado 'access_token 'Hay que poner el token de la aplicacion de dropbox en la variable
req.setRequestHeader "Content-Type", "application/json"
req.setRequestHeader "data", arg
req.Send (result)
If req.Status = 200 Then
Debug.Print req.responseText
Else
Debug.Print req.responseText
End If
End Function
{"name": "upload_dropbox.txt", "path_lower": "/teste/upload_dropbox.txt", "path_display": "/TESTE/upload_dropbox.txt", "id": "id:Ca7-0FuJ0qAAAAAAAAAR-g", "client_modified": "2021-03-27T17:26:32Z", "server_modified": "2021-03-27T17:26:32Z", "rev": "015be87f326712a00000001a74bb870", "size": 53, "is_downloadable": true, "content_hash": "7bf29656b17f2c77e240a22ec4be3a1272e5cf8a8e7801e9a0f8fb87edf6055c"}
arg = "{""path"":""" & varfile & """,""mode"":""overwrite"",""autorename"":false,""mute"":true}"
arg = "{""path"":""" & varfile & """,""mode"":""overwrite"",""autorename"":false,""mute"":true}"