📚 SAP Business One SDK Help

LoadBlobFromFile Method
See Also  Example
pIBlobParams

The database table and its blob field, the key of the record whose blob field is to be set, and the path to the file to be uploaded to the blob field.

Description

Loads a file into a blob field in the SAP Business One database.

Syntax

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

Parameters

pIBlobParams

The database table and its blob field, the key of the record whose blob field is to be set, and the path to the file to be uploaded to the blob field.

Example

Loading a file into a blob field (C#)Copy Code
string blobFile = @"C:\0.gif.zip"; 
SAPbobsCOM.CompanyService oCompanyService = MainModule.oCompany.GetCompanyService();  
 
// Specify the table and field to which to load the blob field 
BlobParams oBlobParams = (BlobParams)oCompanyService.GetDataInterface(SAPbobsCOM.CompanyServiceDataInterfaces.csdiBlobParams); 
oBlobParams.Table = "RDOC"; 
oBlobParams.Field = "Template"; 
 
// Specify the file to load into the DB 
string blobNewFilePath = @"C:\myblobfile1.zip"; 
oBlobParams.FileName = blobNewFilePath; 
 
// Specify the key field and key of the record whose blob field Is to be set 
BlobTableKeySegment oKeySegment = oBlobParams.BlobTableKeySegments.Add(); 
oKeySegment.Name = "DocCode"; 
oKeySegment.Value = "ACT10001"; 
 
// Load file into DB field 
oCompanyService.LoadBlobFromFile(oBlobParams);

See Also