GetFile

GetFile

Filter inputs

Name

Type

Description

Mandatory

Available from version

FileInfoGet

FileInfoGeneral

The information needed to identify the file to be retrevied.

 

 

Response of type GetFileResponse 

Name

Type

Description

Available from version

FileBytes

byte[]

The data of the file as byte array

 

FileName

string

The name of the file

 

FileContentType

string

The content type of the file, as it was saved in BFS

 

CustomFields

CustomFields[]

CustomFields is an array of CustomField objects. Each CustomField consists of two strings, FieldName and Value. There are no datatypes associated with these properties, they are just a way for api-users to add customized data to the object.

2.28

Code examples

//example of how to fetch a file from an instance of BFS var client = new BFSServiceReference.bfsapiSoapClient();   var credentials = new BFSServiceReference.Credentials() { UserName = bfsusername, //Username of administrative user in your instance of BFS Password = bfspassword, //Password of the administrative user in your instance of BFS }; GetFileResponse oResp = client.GetFile(new BFSServiceReference.GeFileRequest() { Credentials = credentials, identify = bfsidentifier, //Identifier is a unique token for your instance of BFS FileInfoGet = new FileInfoGeneral { BrickId = new Guid("3ac97391-451d-4e2f-843b-75124d2e09f2") //an example Guid }, }); if (oResp.Message == "OK") { byte[] oFileByteDL = oResp.FileBytes; System.IO.FileStream oFileStreamDL = null; oFileStreamDL = new FileStream(@"c:\temp\download\" + oResp.FileName, FileMode.Create); //an example of how to save the data being fetched from BFS oFileStreamDL.Write(oFileByteDL, 0, oFileByteDL.Length); oFileStreamDL.Close(); oFileStreamDL = null; }