File Names and Locations After File Uploads
Agents upload files upon requests from a ThingWorx Platform. They can also upload files based on their project configuration. For example, an agent may be configured to watch log files and upload them periodically. Alternatively, an Axeda Gateway or Connector agent might upload a file based on an alarm style configuration.
The basic rules for the names of uploaded files are:
1. Only agents can request the upload of a single, uncompressed file.
2. All platform-initiated requests have a generated file name in the upload location
3. All compressed uploads have a generated file name
4. The general format of the file name for a compressed file uploaded from the Agent is yyyyMMddTHHmmss-<UUID>.tar.gz. The time-stamp is in ISO 8601 UTC date/time format (current timestamp). The UUID is appended to it and given the tar.gz extension. Here is an example generated file name:
20190417T192857.166Z-0994cae8-cdfb-4308-b3da-e35c53829e08.tar.gz
The UUID for an agent-initiated file upload is a random UUID generated by the agent. The metadata for an agent-initiated compressed file transfer contains this UUID. The UUID for a platform-initiated file upload is the TransferID that is shown in the FileTransferEvent.
* 
If the same, single, uncompressed file is uploaded multiple times, the file is overwritten each time that it is uploaded. This behavior deviates from Axeda Platform behavior. The use of a <timestamp> and a <uuid> prevent the overwriting.
Here are examples of target locations, one for an agent-initiated upload and one for a platform-initiated upload:
Upload Initiated by
File Details
Example Target Location
Agent
A single, uncompressed file named xgWatchdog.txt
SystemRepository/uploads/<ThingName>/xgWatchdog.txt
A single file, compressed using tar.gz
SystemRepository/uploads/<ThingName>/<timestamp>-<uuid>.tar.gz
ThingWorx Platform
A single, uncompressed file named xgWatchdog.txt
SystemRepository/uploads/<ThingName>/<timestamp>-<uuid>.tar.gz
A single file, compressed using tar.gz
SystemRepository/uploads/<ThingName>/<timestamp>-<uuid>.tar.gz
* 
If the size of a file to be uploaded is larger than the maximum size specified for compression in compressionHighThreshold, the file is NOT compressed. However, the generated file name is the same as shown in the table.
What Happens to Watched Files and Logger Files When Uploaded to ThingWorx?
Axeda agents can be configured with File Watchers that monitor files and then upload them to a platform, based on a change in their time-stamp or a change in their content (MD5 digest). File Watchers can also monitor a directory and upload the content based on the same types of changes.
When the Agent initiates the file upload and that upload consists of a single, uncompressed file, the name of the file as it exists on the agent is the name of the file when it arrives at the ThingWorx Platform. However, if the agent compresses a file or set of files from a directory, the name of the file when it arrives at the ThingWorx Platform is generated, as explained above.
Uploads of Multiple Files Requested by ThingWorx Platform
ThingWorx Platform does not currently have a built-in capability to extract files compressed in the tar.gz format that is used by Axeda eMessage agents. This behavior differs from that of Axeda Platform since all the files that are included in an archive are listed separately by Axeda Platform, giving the user the experience of being able to enumerate all the files in a given upload.
Uploads with multiple files are always compressed, regardless of where the uploads are initiated. If the sum of all the file sizes to be uploaded is larger than the compressionHighThreshold, the eMessage agent sends a package status error that indicates the multi-file transfer without compression was requested. To request that multiple files be uploaded from the ThingWorx Platform side, you need to specify a pattern in the sourceFile field. Since the Copy service requires the targetFile parameter, you can enter the same pattern as in the sourcFile field. The name will be ignored.
Target Repo
Target Path
Target File
Save Location
System Repository
/uploads/<ThingName>
agent*.log
SystemRepository/uploads/<ThingName>/<timestamp>-<uuid>.tar.gz
AgentLogs
a/b/c
agent*.log
AgentLogs/a/b/c/(timestamp).tar.gz
Was this helpful?