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
)

Parameters

urlOfFile
Type: System.String

A string that specifies the URL for the file.

file
Type: System.IO.Stream

A Stream object that contains the file.

properties
Type: System.Collections.Hashtable

A Hashtable object containing metadata for the file.

overwrite
Type: System.Boolean

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

requireWebFilePermissions
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.
Show:
© 2014 Microsoft