Hello @passuff-4972 ,
By design, Folders and Sub-folders can not support "Download a Copy" feature.
However, you can download folders in the following two ways:
1) Use the "Open with Explorer" option available at the ribbon row. With the Explorer view open, you can copy+paste the folder in total to your local files, which does the same functionality as downloading would.
2) Use SharePoint Designer to access the folder's path, where you can also download the folder with all of its contents.
Thanks,
Echo Du
====================
Updated Answer =================
Hi @passuff-4972 ,
You cannot see the “All Files” in the SharePoint designer, because the “Enable Managing of the Web Site URL Structure" is disabled by your server administrator in the SharePoint Designer settings.
Please following steps:
1) Sign in SharePoint Central Administration as an admin
2) Go to General Application Settings tab, and click "Configure SharePoint Designer settings"
3) Please enable "Enable Managing of the Web Site URL Structure" option under the corresponding web application.
4) After enabling, you will see the “All Files” in the SharePoint designer.
Thanks,
Echo Du
Updated Answer
--------------------------------
Hi @passuff-4972 ,
Please run the below PowerShell script as an admin to download all files(folders) in a Library:
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
#Runtime-Variables
$SiteURL = "siteurl"
$LibraryName ="libraryname"
$DownloadPath ="C:\temp"
#Function to Download All Files from a SharePoint Folder
Function Download-SPFolder($SPFolderURL, $DownloadPath)
{
Try {
#Get the Source SharePoint Folder
$SPFolder = $web.GetFolder($SPFolderURL)
Write-host $SPFolder
$DownloadPath = Join-Path $DownloadPath $SPFolder.Name
#Ensure the destination local folder exists!
If (!(Test-Path -path $DownloadPath))
{
#If it doesn't exists, Create
$LocalFolder = New-Item $DownloadPath -type directory
}
#Loop through each file in the folder and download it to Destination
ForEach ($File in $SPFolder.Files)
{
#Download the file
$Data = $File.OpenBinary()
$FilePath= Join-Path $DownloadPath $File.Name
[System.IO.File]::WriteAllBytes($FilePath, $data)
Write-host -f Green "`tDownloaded the File:"$File.ServerRelativeURL
}
#Process the Sub Folders & Recursively call the function
ForEach ($SubFolder in $SPFolder.SubFolders)
{
If($SubFolder.Name -ne "Forms") #Leave "Forms" Folder
{
#Call the function Recursively
Download-SPFolder $SubFolder $DownloadPath
}
}
}
Catch {
Write-host -f Red "Error Downloading Document Library:" $_.Exception.Message
}
}
#Main Function
Function Download-SPDocumentLibrary($SiteURL, $LibraryName, $DownloadPath)
{
Try {
#Get the Web
$Web = Get-SPWeb $SiteURL
#Delete any existing files and folders in the download location
If (Test-Path $DownloadPath) {Get-ChildItem -Path $DownloadPath -Recurse| ForEach-object {Remove-item -Recurse -path $_.FullName }}
#Get the document Library to Download
$Library = $Web.Lists[$LibraryName]
Write-host -f magenta "Downloading Document Library:" $Library.Title
#Call the function to download the document library
Download-SPFolder -SPFolderURL $Library.RootFolder.Url -DownloadPath $DownloadPath
Write-host -f Green "*** Download Completed ***"
}
Catch {
Write-host -f Red "Error Downloading Document Library:" $_.Exception.Message
}
}
#Call the Function to export all document libraries from a site
Download-SPDocumentLibrary $SiteURL $LibraryName $DownloadPath
Thanks,
Echo Du
+++++++++++++++++ Updated Answer +++++++++++++++
Hi @passuff-4972 ,
I have changed my powershell script.
Add-PSSnapin Microsoft.Sharepoint.Powershell
$SiteURL = "http://sp/sites/echo"
$LibraryName ="Documents"
$DownloadPath ="C:\temp"
Function Download-SPFolder($SPFolderURL, $DownloadPath)
{
Try {
$SPFolder = $web.GetFolder($SPFolderURL)
Write-host $SPFolder
$DownloadPath = Join-Path $DownloadPath $SPFolder.Name
If (!(Test-Path -path $DownloadPath))
{
$LocalFolder = New-Item $DownloadPath -type directory
}
#Loop through each file in the folder and download it to Destination
ForEach ($File in $SPFolder.Files)
{
#Download the file
$Data = $File.OpenBinary()
$FilePath= Join-Path $DownloadPath $File.Name
[System.IO.File]::WriteAllBytes($FilePath, $data)
Write-host -f Green "`tDownloaded the File:"$File.ServerRelativeURL
}
#Process the Sub Folders & Recursively call the function
ForEach ($SubFolder in $SPFolder.SubFolders)
{
If($SubFolder.Name -ne "Forms")
{
#Call the function Recursively
Download-SPFolder $SubFolder $DownloadPath
}
}
}
Catch {
Write-host -f Red "Error Downloading Document Library:" $_.Exception.Message
}
}
#Main Function
Function Download-SPDocumentLibrary($SiteURL, $LibraryName, $DownloadPath)
{
Try {
#Get the Web
$Web = Get-SPWeb $SiteURL
#Delete any existing files and folders in the download location
If (Test-Path $DownloadPath) {Get-ChildItem -Path $DownloadPath -Recurse| ForEach-object {Remove-item -Recurse -path $_.FullName }}
#Get the document Library to Download
$Library = $Web.Lists[$LibraryName]
Write-host -f magenta "Downloading Document Library:" $Library.Title
#Call the function to download the document library
Download-SPFolder -SPFolderURL $Library.RootFolder.Url -DownloadPath $DownloadPath
Write-host -f Green "*** Download Completed ***"
}
Catch {
Write-host -f Red "Error Downloading Document Library:" $_.Exception.Message
}
}
Download-SPDocumentLibrary $SiteURL $LibraryName $DownloadPath
Thanks,
Echo Du
======================
If an Answer is helpful, please click "Accept Answer" and upvote it.
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.