Hi @Tevon2.0 ,
By design, Folders and Sub-folders can not support the OOTB "Download a Copy" feature.
As a workaround, you can download specific folders using powershell (You need to replace SharePointFolderUrl and LocalFolderPath in the last line of code).
The url of a specific folder/subfolder can be viewed by the end of the URL of the page(%2F = Forward slash (/), %20= Forward slash (Space)), for example:
Add-PSSnapin Microsoft.Sharepoint.PowerShell
function Download-Folder
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$true)][string]$SharePointFolderUrl,
[Parameter(Mandatory=$true)][string]$Path,
[Parameter(Mandatory=$false)][switch]$Recurse
)
begin
{
}
process
{
$site = New-Object Microsoft.SharePoint.SPSite($SharePointFolderUrl)
$web = $site.OpenWeb()
$folder = $web.GetFolder($SharePointFolderUrl)
if( $folder.Exists )
{
Write-Verbose "$(Get-Date) - Processing Folder: $($folder.ServerRelativeUrl)"
foreach( $file in $folder.Files )
{
$fileUrl = $site.MakeFullUrl($file.ServerRelativeUrl)
Write-Verbose "$(Get-Date) - Downloading File: $($fileUrl)"
$response = Invoke-WebRequest -Uri $fileUrl -UseDefaultCredentials -Verbose:$false
try
{
# combine the provided path to the server relative url
$savePath = Join-Path -Path $Path -ChildPath $file.ParentFolder.ServerRelativeUrl
# ensure the folder exists
New-Item -Path $savePath -ItemType Directory -Force | Out-Null
# add the file name to the path
$savePath = Join-Path -Path $savePath -ChildPath $file.Name
# save the bits locally
$stream = New-Object System.IO.FileStream( $savePath, [System.IO.FileMode]::Create, [System.IO.FileAccess]::ReadWrite)
$response.RawContentStream.CopyTo($stream)
}
finally
{
if( $stream )
{
$stream.Close()
$stream.Dispose()
}
}
}
if( $Recurse )
{
foreach( $subFolder in $folder.SubFolders )
{
if( $subFolder.Item )
{
$subFolderUrl = $site.MakeFullUrl($subFolder.ServerRelativeUrl)
Download-Folder -SharePointFolderUrl $subFolderUrl -Path $Path -Recurse
}
}
}
}
}
end
{
}
}
Download-Folder -SharePointFolderUrl "http://sp19/sites/luyi19/Shared Documents/folder1" -Path "C:\SP" -Recurse -Verbose
The download effect diagram after running is shown in the figure below (it will automatically create a local folder to store the file):
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.