Hi All.
I'm using the below code in powershell but for some reason the files get corrupted once they arrived to dropbox folder. If i transfer the file manually there's no issues, the error it's present only using the dropbox API, do you have and idea why this happened?
Regards.
$SourceFilePath = "PathSource"
$TargetFilePath = "PathDestination"
$arg = '{ "path": "' + $TargetFilePath + '", "mode": "add", "autorename": true, "mute": false }'
#$authorization = "Bearer " + (get-item env:DropBoxAccessToken).Value
$authorization = "Bearer " + 'KEY'
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Authorization", $authorization)
$headers.Add("Dropbox-API-Arg", $arg)
$headers.Add("Content-Type", 'application/octet-stream')
Invoke-RestMethod -Uri https://content.dropboxapi.com/2/files/upload -Method Post -InFile $SourceFilePath -Headers $headers