Export (0) Print
Expand All

SPFileCollection.Add Method (String, Byte[], Boolean, String, Boolean)

Windows SharePoint Services 3

Creates a file in the collection based on the specified URL, byte array that contains a file, check-in comment, and Boolean value specifying whether to check required fields, overwriting any file of the same name only if overwrite is true.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

public SPFile Add(
	string urlOfFile,
	byte[] file,
	bool overwrite,
	string checkInComment,
	bool checkRequiredFields
)

Parameters

urlOfFile
Type: System.String
A string that specifies the URL for the file.
file
Type: []
A byte array containing the file.
overwrite
Type: System.Boolean
true to overwrite a file of the same name; otherwise, false.
checkInComment
Type: System.String
A string containing a check-in comment to use when creating the file in the collection.
checkRequiredFields
Type: System.Boolean
true to check required fields when saving the file; otherwise, false.

Return Value

Type: Microsoft.SharePoint.SPFile
An SPFile object that represents the file.

Community Additions

ADD
Show:
© 2014 Microsoft