Export (0) Print
Expand All

SPFileCollection.Add method (String, Stream, Hashtable, Boolean, Boolean)

Creates a file in the collection based on the specified URL, a Stream object that contains a file, and a hash table that contains metadata for the file.

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

public SPFile Add(
	string urlOfFile,
	Stream file,
	Hashtable properties,
	bool overwrite,
	bool requireWebFilePermissions


Type: System.String

A string that specifies the URL for the file.

Type: System.IO.Stream

A Stream object that contains the file.

Type: System.Collections.Hashtable

A Hashtable object containing metadata for the file.

Type: System.Boolean

true to overwrite a file of the same name; otherwise, false.

Type: System.Boolean

true to indicate that adding Web files requires the Add and Customize Web Pages permission; otherwise, false. The default is true.

Return value

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