SPFileCollection.Add Method (String, Stream)

Creates a file in the collection based on the specified URL and on a Stream object that contains a file.

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

Syntax

Public Function Add ( _
    urlOfFile As String, _
    stream As Stream _
) As SPFile

Dim instance As SPFileCollection
Dim urlOfFile As String
Dim stream As Stream
Dim returnValue As SPFile

returnValue = instance.Add(urlOfFile, _
    stream)
public SPFile Add(
    string urlOfFile,
    Stream stream
)

Parameters

  • urlOfFile
    Type: System.String
    A string that specifies the URL for the file.
  • stream
    Type: System.IO.Stream
    A System.IO.Stream object that contains the file.

Return Value

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

See Also

Reference

SPFileCollection Class

SPFileCollection Members

Add Overload

Microsoft.SharePoint Namespace