We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
nive
3 years agoExplorer | Level 4
Not able to access the folders inside scoped app folder
There is a scoped app folder , and Im trying to access a zip file in a folder called "myfolder" in the Apps folder . In the script , I gave the dropbox path as /Apps/myfolder/download.zip , however ...
karver
3 years agoNew member | Level 2
i need to download zip file from dropbox
this is the error i am receiving :
Invoke-RestMethod : {"error_summary": "path/not_found/...", "error": {".tag": "path", "path": {".tag": "not_found"}}}
My script looks like this
function Get-DropboxFolder{
[CmdletBinding()]
Param(
[string]$DropboxFolder,
[string]$OutputFolder,
[string]$FolderPath
)
$body = '{"path":"/'+$DropboxFolder+'"}'
Write-Output $body
$AuthToken = 'xxxxxxxx'
$token = "Bearer $AuthToken"
#The file will be downloaded as ZIP to the Temp folder of the user
$Tempfolder = "$env:temp\Downloaded_File.zip"
if (!(Test-Path $FolderPath)) {
Write-Verbose "Downloading the folder…"
Invoke-RestMethod `
-Method POST `
-Headers @{ "Authorization" = $token; "Dropbox-API-Arg" = $body} `
-OutFile $Tempfolder -ContentType ""
#The file will be extracted and then removed from the temp
write-verbose "Extracting the folder…"
Expand-Archive -LiteralPath $Tempfolder -DestinationPath $OutputFolder -Force
Remove-Item $Tempfolder -Force
Write-Verbose "The folder has been downloaded."
}
else{
Write-Verbose "Folder Exists"
}
}
$DropboxFolder = "Apps/WAE-DE-dev-win11/file.zip"
$OutputFolder = "$env:HOMEDRIVE\Softwares"
$FolderPath = "$OutputFolder\Software01"
Get-DropboxFolder -DropboxFolder $DropboxFolder -OutputFolder $OutputFolder -FolderPath $FolderPath -Verbose
Здравко
3 years agoLegendary | Level 20
Hi karver,
You have 2 errors, at least. The first one is obvious - you have pointed something that doesn't exist (likely it's the same as explained before; not mandatory, of course). The other one is the fact that you're trying to download folder content using method suitable for files only! To be able download a folder as zip file take a look on /2/files/download_zip. 😉
Hope this gives direction.
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!