SPFile.SaveBinary method (Byte[])

Saves the file in binary format based on the specified byte array.

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

public void SaveBinary(
	byte[] file
)

Parameters

file
Type: []

A byte array that contains the file.

ExceptionCondition
Exception

An error occurred while saving the file.

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

If versioning is enabled for the document library that contains the file, the SaveBinary method creates an SPFileVersion object.

Show: