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)

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.

ExceptionCondition
SPException

An error occurred while saving the file.

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

Show: