📚 SAP Business One SDK Help

SaveBlobToFile Method
See Also  Example
pIBlobParams

The database table and its blob field, the key of the record whose blob field is to be saved to a file, and the path of the file to be saved with the contents of the blob field.

Description

Saves to a file the contents of a blob field in the SAP Business One database.

Syntax

Visual Basic
Public Sub SaveBlobToFile( _
   ByVal pIBlobParams As BlobParams _
) 

Parameters

pIBlobParams

The database table and its blob field, the key of the record whose blob field is to be saved to a file, and the path of the file to be saved with the contents of the blob field.

Example

Saving a blob field to a file (C#)Copy Code
// Specify the table and blob field 
BlobParams oBlobParams = (SAPbobsCOM.BlobParams)oCompanyService.GetDataInterface(SAPbobsCOM.CompanyServiceDataInterfaces.csdiBlobParams); 
oBlobParams.Table = "RDOC"; 
oBlobParams.Field = "Template"; 
 
// Specify the file name to which to write the blob 
string blobNewFilePath = @"C:\myblobfile.zip"; 
oBlobParams.FileName = blobNewFilePath; 
 
// Specify the key field and value of the row from which to get the blob 
BlobTableKeySegment oKeySegment; 
oKeySegment = oBlobParams.BlobTableKeySegments.Add(); 
oKeySegment.Name = "DocCode"; 
oKeySegment.Value = "ACT10001"; 
 
// Save the blob to the file 
oCompanyService.SaveBlobToFile(oBlobParams); 
 

See Also