Is your feature improvement request related to a problem? Please describe.
When files are uploaded to Cumulocity from thin-edge.io, the files do not included meta information like the filename. This results in a suboptimal user experience when the user downloads the file from the UI, as the downloaded file will automatically get the filename set to the event id (as the filename was not provided when the file was uploaded).
The file upload is used in the following thin-edge.io features:
Log file request
Configuration snapshow request
Here is a screenshot showing that when the user clicks on the "download" button on the events page, that the downloaded filename is set to the event id (which is not helpful to the user)
In comparison, when the filename is set, then it is used when downloading from the UI (the file was uploaded using go-c8y-cli):
This can be achieved by using a multipart/form-data request, where the Content-Disposition header includes meta information about the filename that is being uploaded.
For example, the data.txt file is uploaded (attached) to the Cumulocity IoT event id 36200 using the following go-c8y-cli command (which shows the multipart/form-data request as a HTTP dump):
The filename should also include some information about the device it is coming from (to make it easier for users to compare files from multiple devices). The following filename format is proposed:
<external_id>_<filename>
Where <external_id> is the @id name of the device/service related to the operation/command where the file is coming from, e.g. mygateway:device:child01 or mygateway.
Is your feature improvement request related to a problem? Please describe.
When files are uploaded to Cumulocity from thin-edge.io, the files do not included meta information like the filename. This results in a suboptimal user experience when the user downloads the file from the UI, as the downloaded file will automatically get the filename set to the event id (as the filename was not provided when the file was uploaded).
The file upload is used in the following thin-edge.io features:
Here is a screenshot showing that when the user clicks on the "download" button on the events page, that the downloaded filename is set to the event id (which is not helpful to the user)
In comparison, when the filename is set, then it is used when downloading from the UI (the file was uploaded using go-c8y-cli):
Describe the solution you'd like
Set the
filename
when uploading a file to the Cumulocity Event Attachment API.This can be achieved by using a
multipart/form-data
request, where theContent-Disposition
header includes meta information about the filename that is being uploaded.For example, the
data.txt
file is uploaded (attached) to the Cumulocity IoT event id36200
using the following go-c8y-cli command (which shows the multipart/form-data request as a HTTP dump):Filename convention
The filename should also include some information about the device it is coming from (to make it easier for users to compare files from multiple devices). The following filename format is proposed:
Where
<external_id>
is the@id
name of the device/service related to the operation/command where the file is coming from, e.g.mygateway:device:child01
ormygateway
.Describe alternatives you've considered
Additional context