Hello,
I am trying to upload files as you would do manually in the browser, but using an API. When dragging and dropping a file into the attachments tabs of any section, I see in the browser that Creatio performs a POST request to its FileApiService with a format like the following example:
The endpoint is https://my-creatio-site.creatio.com/0/rest/FileApiService/UploadFile and the file content is passed in the request body.
In order to simulate this behavior, I am sending 2 requests:
-
A POST request to create the file id allocating space in the File table:

- A POST request to https://my-creatio-site.creatio.com/0/rest/FileApiService/UploadFile using the file information to upload the actual file.
However as you can see, the 2nd request fails in my app with the following error:
{
"errorInfo": {
"errorCode": "InvalidFileSizeException",
"message": "No se puede analizar el tamaño del archivo.",
"stackTrace": " at Terrasoft.Configuration.FileUpload.FileUploadInfo.get_TotalFileLength()\r\n at Terrasoft.Configuration.FileUpload.FileUploader.UploadFile(IFileUploadConfig fileUploadInfoConfig)\r\n at Terrasoft.Configuration.FileUpload.FileUploader.UploadFile(IFileUploadInfo fileUploadInfo, Boolean isSetCustomColumns)\r\n at Terrasoft.Configuration.FileApiService.UploadFile(Stream fileContent)"
},
"success": false,
"nextPrcElReady": false,
"queryId": null,
"responseStatus": {
"ErrorCode": "InvalidFileSizeException",
"Message": "No se puede analizar el tamaño del archivo.",
"StackTrace": " at Terrasoft.Configuration.FileUpload.FileUploadInfo.get_TotalFileLength()\r\n at Terrasoft.Configuration.FileUpload.FileUploader.UploadFile(IFileUploadConfig fileUploadInfoConfig)\r\n at Terrasoft.Configuration.FileUpload.FileUploader.UploadFile(IFileUploadInfo fileUploadInfo, Boolean isSetCustomColumns)\r\n at Terrasoft.Configuration.FileApiService.UploadFile(Stream fileContent)",
"Errors": null,
"Meta": null
},
"rowsAffected": -1
}
I already ensured that the file size passed in both requests is exactly the same always (in this example is 584833 bytes) but I don't know what causes the error.
I already checked the following community posts but couldn't find any help:
Note: I tested these requests in many Creatio websites, all of them with version 8.2.0
Regards.