Interface IFileCollection
Public interface to define a collection of File objects
Assembly: PnP.Core.dll
Syntax
public interface IFileCollection : IDataModelCollection<IFile>, IDataModelParent, IDataModelWithContext, IRequestableCollection, IDataModelCollectionLoad<IFile>, IDataModelCollectionDeleteByGuidId, ISupportModules<IFileCollection>
Methods
Add a file to the file collection using batching (sync)
Declaration
IFile Add(string name, Stream content, bool overwrite = false)
Parameters
System.String
name
The name of the file.
|
Stream
content
The content of the file.
|
System.Boolean
overwrite
Indicates whether the file should be overwritten if already existing.
|
Returns
IFile
The added file object.
|
Add a file to the file collection using batching (async)
Declaration
Task<IFile> AddAsync(string name, Stream content, bool overwrite = false)
Parameters
System.String
name
The name of the file.
|
Stream
content
The content of the file.
|
System.Boolean
overwrite
Indicates whether the file should be overwritten if already existing.
|
Returns
Task<IFile>
The added file object.
|
Adds a file based upon an out of the box template
Declaration
IFile AddTemplateFile(string serverRelativePageName, TemplateFileType templateFileType)
Parameters
System.String
serverRelativePageName
Server relative url of the page to add
|
TemplateFileType
templateFileType
Type of template file to add
|
Returns
Adds a file based upon an out of the box template
Declaration
Task<IFile> AddTemplateFileAsync(string serverRelativePageName, TemplateFileType templateFileType)
Parameters
System.String
serverRelativePageName
Server relative url of the page to add
|
TemplateFileType
templateFileType
Type of template file to add
|
Returns
Extension Methods