We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
Phydeaux
6 years agoExplorer | Level 3
Powershell File Upload - Bad Request
Hello,
First off, I did search the forums. This post , titled the same as this help request, seemed similar but was not helpful.
I have the following simple curl upload working fine: ...
Greg-DB
Dropbox Community Moderator
6 years agoCan you print out the response body for the call made by the PowerShell code? It should contain a more useful error message indicating what the issue is in that case.
Heinek
5 years agoExplorer | Level 4
Hey, I know i'm necroing this thread, but I'm in the exact same situation as OP, and hope you've somehow seen and solved other cases since.
Works fine in insomnia, but powershell refuses to cooperate.
Ive put it in a try catch, but there is no info in the exception what so ever.
Edit:
As always, the solution comes after you asked someone for help.
I had not considered that the target path and filename was not in quotes, so the json was wrong. I use arguments in azure pipelines, so it eluded me completely.
Ended up with this:
$targetPathAndFilename = ' "/Folder/file.exe" '
$arg = '{ "path": '+$targetpathAndFilename+', "mode": "add", "autorename": true, "mute": false }'
- Greg-DB5 years ago
Dropbox Community Moderator
I'm glad to hear you already sorted this out.
For future reference, or for anyone else in a similar scenario, make sure you read out the response body, as it will generally contain a more specific error message which can help you debug issues like this. It sounds like PowerShell doesn't show that by default, but you can read it as described in this thread.
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!