Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Filter inputs

Name
Type
Description
MandatoryAvailable from version
FileInfoGetFileInfoGeneralThe information needed to identify the file to be retrevied.  

Response of type GetFileResponse 

Name
Type
Description
Available from version
FileBytesbyte[]The data of the file as byte array 
FileNamestringThe name of the file 
FileContentTypestringThe content type of the file, as it was saved in BFS 

Code examples

Code Block
languagec#
themeRDark
titleC# - Example of fetching a file from BFS
linenumberstrue
collapsetrue
//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;
            }

...