Versions Compared

Key

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

This the method available to delete a file in the BFS. Since the mandatory BrickId must be supplied in the FileInfoDelete one should always get the information of this via GetFileList.

Filter inputs

NameTypeDescription
FileInfoDeleteFileInfoGeneral 
DeleteFilebool 
   

Response rows (Array)

 
NameTypeDescription
 The information needed to delete a file, in this case the BrickId property of FileInfoGeneral is mandatory

Response rows (Array)

NameTypeDescription
MessageStringThe result of the operation(success="OK")
Code Block
languagec#
themeRDark
titleC# example
collapsetrue
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
};
Guid oG = new Guid("39bc0ada-3c40-4866-81cd-04bbc77b998b"); //previously fetched
DeleteFileRequest oReq = new DeleteFileRequest();
oReq.Credentials = credentials;
oReq.identify = Identify; //Unique token to identify
oReq.FileInfoDelete = new FileInfoGeneral
{
BrickId = oG
};
DeleteFileResponse oRep = client.DeleteFile(oReq);
if (oRep.Message=="OK")
{
Console.Writeline("File deleted successfully");
}
else
{
Console.Writeline(string.format("Delete of file not successful: {0}", Rep.Message));
}