What Is the Force Delete Flag on the SystemLink File Service API?

Updated Sep 16, 2024

Reported In

Software

  • SystemLink Server
  • LabVIEW SystemLink Toolkit

Issue Details

  • When using the SystemLink File Service API, there is a force flag when deleting a file. What does this flag do?
  • I am using the /v1/service-groups/Default/files/{id} HTTP API in SystemLink and want to understand the purpose of the force query.
  • The LabVIEW SystemLink Toolkit includes a Delete VI for files. When should the force file deletion input be used?

Solution

When using the SystemLink File Service to delete a file, the force flag/query can be used in case of file corruption.

When a file is uploaded to the SystemLink Web UI, it is stored in the File Service of the SystemLink Server at C:\ProgramData\National Instruments\Skyline\Data\FileIngestion\<file id>. If the data in this path is modified or deleted, the file will still appear in the UI, but it no longer exists as expected in the File Service.

If you attempt to delete a file with the force flag set to false, error code -251613 (or response code 401 for HTTP) will appear as shown below.

image (1).png
could not delete error.PNG

When the force flag is set to true, the deletion can execute successfully and any remaining file data will be cleaned up.

Additional Information

When using the HTTP API, the force flag is included in the request URL.

HTTP Delte file.PNG

When using the LabVIEW Toolkit, the flag is set on the force file deletion input of the Delete VI.

Delete file LV.PNG