Share via


SPFile.SaveBinary method (Byte[], Boolean)

Saves the file in binary format based on the specified byte array and a Boolean value that specifies whether to check required fields.

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

Syntax

'Declaration
Public Sub SaveBinary ( _
    file As Byte(), _
    checkRequiredFields As Boolean _
)
'Usage
Dim instance As SPFile
Dim file As Byte()
Dim checkRequiredFields As Boolean

instance.SaveBinary(file, checkRequiredFields)
public void SaveBinary(
    byte[] file,
    bool checkRequiredFields
)

Parameters

  • file
    Type: []

    A byte array that contains the file.

  • checkRequiredFields
    Type: System.Boolean

    true to check required fields when saving the file; otherwise, false.

Exceptions

Exception Condition
SPException

An error occurred while saving the file.

Remarks

This method calls SaveBinary(Stream, Boolean, Boolean, String, String, Stream, String) with new MemoryStream(file), checkRequiredFields, false, null , null , null , and an unused string.

See also

Reference

SPFile class

SPFile members

SaveBinary overload

Microsoft.SharePoint namespace