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)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
Syntax
'Declaration
Public Sub SaveBinary ( _
file As Byte() _
)
'Usage
Dim instance As SPFile
Dim file As Byte()
instance.SaveBinary(file)
public void SaveBinary(
byte[] file
)
Parameters
file
Type: []A byte array that contains the file.
Exceptions
Exception | Condition |
---|---|
Exception | An error occurred while saving the file. |
Remarks
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.