Share via


File.SaveBinaryDirect method (ClientContext, String, Stream, Boolean)

Uploads the specified file to a SharePoint site without requiring an ExecuteQuery() method call.

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

Syntax

'Declaration
Public Shared Sub SaveBinaryDirect ( _
    context As ClientContext, _
    serverRelativeUrl As String, _
    stream As Stream, _
    overwriteIfExists As Boolean _
)
'Usage
Dim context As ClientContext
Dim serverRelativeUrl As String
Dim stream As Stream
Dim overwriteIfExists As BooleanFile.SaveBinaryDirect(context, serverRelativeUrl, _
    stream, overwriteIfExists)
public static void SaveBinaryDirect(
    ClientContext context,
    string serverRelativeUrl,
    Stream stream,
    bool overwriteIfExists
)

Parameters

  • serverRelativeUrl
    Type: System.String

    A string that represents the server-relative URL of the file.

  • overwriteIfExists
    Type: System.Boolean

    A Boolean value that specifies whether the file is overwritten if it already exists.

See also

Reference

File class

File members

SaveBinaryDirect overload

Microsoft.SharePoint.Client namespace