Table of contents
TOC
Collapse the table of content
Expand the table of content

FileFolderExtensions.SaveFileToLocal Method

SharePoint Dev Documents|Last Updated: 5/20/2017
|
1 Contributor

Saves a remote file to a local folder

Namespace:Microsoft.SharePoint.Client
Assembly: OfficeDevPnP.Core.dll

Syntax

public static void SaveFileToLocal(this Web web, String serverRelativeUrl, String localPath, String localFileName, Func<String, Boolean> fileExistsCallBack)

Parameters

web

  Type: Microsoft.SharePoint.Client.Web
  The Web to process

serverRelativeUrl

  Type: System.String
  The server relative url to the file

localPath

  Type: System.String
  The local folder

(optional) localFileName

  Type: System.String
  The local filename. If null the filename of the file on the server will be used

(optional) fileExistsCallBack

  Type: System.Func<System.String, System.Boolean>
  Optional callback function allowing to provide feedback if the file should be overwritten if it exists. The function requests a bool as return value and the string input contains the name of the file that exists.

Return Value

Type: void

See also

© 2018 Microsoft