Cmdlets for Microsoft SharePoint

Build 24.0.9060

DownloadDocument

Downloads a document from the SharePoint library.

Stored Procedure Specific Information

Insert

RemoteFile can be both relative to the library, or it can be the full URL of the file. Below are some examples:

EXECUTE DownloadDocument File = 'C:/Users/User/Desktop/DownloadedFile.txt', Library = 'Shared Documents', RemoteFile = 'https://mysite.sharepoint.com/Shared Documents/newFolder/FileToDownload.txt';

EXECUTE DownloadDocument File = 'C:/Users/User/Desktop/DownloadedFile.txt', Library = 'Shared Documents', RemoteFile = '/newFolder/FileToDownload.txt';

Input

Name Type Description
File String The path of the file to be saved. You should include the new filename. For example, 'C:/Users/User/Desktop/DownloadedFile.txt'.
Library String The name of the library on the SharePoint server. For example, 'Shared Documents'.
RemoteFile String This can be either the relative path to the library or the full URL of the file.
Encoding String The data is output to FileData in the specified encoding.

The allowed values are NONE, BASE64.

The default value is BASE64.

ReadTimeout String How many seconds the download may run. If given, the download always fails if it runs longer than this, unlike Timeout which only triggers if the download stalls.

Result Set Columns

Name Type Description
Success Boolean Indicates whether the operation was successful or not.
FileData String The downloaded file content. Only returned if File and FileStream is not set.

Copyright (c) 2024 CData Software, Inc. - All rights reserved.
Build 24.0.9060