File Transfer Format


If files are attached to a message, a special content type application/x-acro-filetransfer+json is used.


        "body" : "Nice pics",
        "attachments" : [
                        "content-type" : "image/jpeg",
                        "content-url" : "https://the.location.of/the/attachment.jpg",
                        "content-size" : 20000,
                        "filename" : "original_filename_if_any.jpg",
                        "description" : "text for the particular attachment - not used so far",
                        "encryption-key" : "0102f03cab.....",
                        "hash" : "12638292",
                        "preview" :
                                "content-type" : "image/jpeg",
                                "content" : "BASE64"
                        "..." : " ... another attachment ... "
Optional. Text applying to attachment(s)

The array of individual attachment dictionaries.

Optional. If not present image/jpeg is assumed.
Mandatory. It is the location from where to download the data.
Optional. It is used to decide whether to download the file automatically or let the user start the download explicitly.
Optional. If it makes sense to preserve it e.g. when sending a named document from the filesystem, it should be set to the original filename on the sending device. It does not make sense to set it for e.g. a photo sent directly from the camera.
Optional. It is hex-encoded AES128 CTR key. AES192 and AES256 are also supported. If present, the binary data downloaded from the content-url need to be decrypted using this key. Example script for decription is available here.
Optional. It is CRC32 digest of the decrypted (if encryption-key is present) binary data downloaded from the content-url. If present, it should be used to verify the integrity of the downloaded and decrypted (if encryption-key is present) data. Example script for decription and integrity check is available here.

Optional. If present it’s a very low quality representation of the data to be downloaded. The preview image is used in the GUI until the actual content is downloaded and better quality local preview is generated.

Optional, if not present, image/jpeg is assumed.
Mandatory. It’s a BASE64 representation of the preview image.