Skip Navigation
Expand
  • Advanced SearchOpens new dialog
    Enter plus (+) or minus (-) signs in search terms to make a word required or excluded
    Search Tips
    Filter by product
    Filter by category
REST download of all of an incident's attachments will truncate a filename with 100 characters to 99 characters
Answer ID 11961   |   Last Review Date 09/02/2021

When I download all of an incident's file attachments as a tar file in a REST request, why does a filename with 100 characters have the filename in the tar file truncated to 99 characters.

Environment:

REST API

Issue:

The product allows file attachments with a filename up to 100 characters. However when all of an incident's file attachments are downloaded as a tar file in a REST request, such as below, an attachment with with a filename of 100 characters will have its filename in the downloaded tar file truncated to 99 characters.
https://sitename.custhelp.com/services/rest/connect/latest/incidents/10414/fileAttachments?download

Resolution:

Some versions of the Unix tar program have internal limitation on the length of filenames of 99 characters. A filename longer than will cause an error. In order to avoid the chance of that occurring, when constructing the tar file to be sent in a REST download request of all of an incident's file attachments, the API with truncate a filename of 100 characters to 99 characters.

One way to work with that limitation is to rename that file after untarring it from long_file_name.tx to long_file_name.txt.

Another way is download an incidents file attachments individually.

A REST request similar to below will return a information on all of incident's file attachments.
https://sitename.custhelp.com/services/rest/connect/latest/incidents/10414/fileAttachments

A request for information about an individual file attachment will have the attachment's filename in the reponse.
https://sitename.custhelp.com/services/rest/connect/latest/incidents/10414/fileAttachments/457

The filename included in the previous response can then be used when saving the attachment from a download request.
https://sitename.custhelp.com/services/rest/connect/latest/incidents/10414/fileAttachments/457?download