Task SharePoint - Download File
The SharePoint - Download file(s) Task downloads the files on a SharePoint site that match a file filter to a local folder, using a SharePoint Connection.
The SharePoint Tasks work with SharePoint 2010, 2013 and 2016 on premises, and with SharePoint Online.
This Task uses a SharePoint Connection; see Connection - SharePoint. When a certificate is selected in the Connection, the Task accepts any server certificate, and each run of a SharePoint Task changes TLS handling for the whole Server process.
The Main settings, Flow, On error, Conditions and TimeOut tabs are the same for every Task; see Job - Tasks.
Download file(s): Remote file filter tab

Remote file filter: Location tab
- Connection: the SharePoint Connection to use. The button next to the list manages Connections
- Source folder: the folder or document library on the SharePoint site, as a server-relative path. The folder button next to the field opens a browser of the site
- Item mask: the names of the items to download. "" matches any characters and "?" one character; separate several masks with ";". The default is ""
- Filter: "Files" (default), "Folders" or "All", the kind of item that matches
- Case sensitive: match Item mask with case
- Include sub folders: also search the folders under Source folder
Variables are resolved in Source folder and Item mask.
Remote file filter: Date tab
- Newer than and Older than: in each group, select "Don't check" (default), "Created date" or "Modified date", and enter a date or a Variable. An item matches Newer than when it is newer than the date, and Older than when it is older
- The "AND" (default) or "OR" list between the groups: whether an item must match both groups or one of them
Both "Created date" and "Modified date" compare the date with the modified date of the item. With "OR", set at least one of the groups; when neither is set, no item matches.
Remote file filter: Size tab
- Check if file is smaller than x size and Check if file is larger than x size: match items smaller or larger than the size, in "byte(s)", "kilobyte(s)", "megabyte(s)", "gigabyte(s)" or "terabyte(s)"
- The "AND" (default) or "OR" list between the groups: whether an item must match both checks or one of them
With "OR", every item matches unless Check if file is smaller than x size is checked.
Remote file filter: Result tab
- Sort (in the Sort result group): sort the matching items by "Full path", "File name", "Modified date", "Created date" or "File size", "Ascending" or "Descending". Sorting by "Full path" makes the Task fail with an error; use another column
- Limit (in the Limit result group): use only the first number of matching items, after sorting. The value can be a Variable
Remote file filter: Test tab
Click Show filtered files to ask the Server for the items that match the current settings. The number of items found and the time it took are shown.
Only files are downloaded. Matching folders are skipped.
Download file(s): Destination tab

- Credentials: the Credential that the Task runs as when it writes to Destination folder. With "No Credential", the Task writes as the account that runs the Server
- Destination folder: the local folder to save the files in. The folder button next to the box opens a folder browser. The folder is created when it does not exist. With Include sub folders, the folders under Source folder are created under it. Variables are resolved
- Overwrite if existing (default), Overwrite if source is newer and Don't overwrite: what to do when a file with the same name is in Destination folder
- Delete source file after download: delete each file from the SharePoint site after it is downloaded
With Don't overwrite, a file that exists in Destination folder makes the Task stop with an error, and the files after it are not downloaded. With Overwrite if source is newer, so does a file whose local copy is not older than the SharePoint file.
With Overwrite if existing (default), a local file with the same name is replaced. With Delete source file after download, a file that is not downloaded because of Don't overwrite or Overwrite if source is newer is still deleted from the SharePoint site. When a downloaded file cannot be deleted, it stays on the site, and the Task reports success.
Output and errors
The output of the Task is the local path of each downloaded file, one per line. When no file matches, the Task downloads nothing and succeeds. When a file cannot be downloaded, the Task fails with the error and goes on with the next file.