Updated v3.7
Upload Message Attachments
This article covers uploading files (attachments) to a message with the preferred method which is to use the binary upload method — the same method as the LiquidFiles web interface and all the LiquidFiles plugins like the Outlook plugin, Mac/IOS app and so on.
The basic minimal functionality is as follows:
POST https://liquidfiles.company.com/message/attachments/upload?filename=somefile.ext
RAW BINARY FILEDATA
Info | Value |
---|---|
Request URL | /message/attachments/upload |
Request VERB | POST |
Parameter | Type | Description |
---|---|---|
filename | String | The filename of the uploaded file. |
content_type | String | (Optional) LiquidFiles first use the Content-Type HTTP header if that's set (see the example below). If the Content-Type header is not set it will use this optional parameter. If neither are set, the Content-Type will be detected using the Linux `file` command. |
chunks | Integer | (Optional) When uploading files in chunks (in pieces), these are the total number of pieces there is. Please see the Chunks article for documentation how to use chunks. |
chunk | Integer | (Optional and required when chunks is set) When uploading files in chunks, this is the current chunk number, with the first chunk being chunk number 0 (zero). |
Please see the Attachment Attributes documentiation for a description of the Response Parameters.
Example Using curl
The Response has been formatted for readability (added indendation and linebreaks).
curl -X POST --user "ojubiigauS2TxTy4ovk6Ph:x" \
-H "Accept: application/json" \
-H "Content-Type: image/gif" \
--data-binary "@someimage.gif" \
https://liquidfiles.company.com/message/attachments/upload?filename=someimage.gif
{"attachment":
{
"id":"VodoHHSnzG0DltkXihNPSF",
"filename":"someimage.gif",
"size":45324,
"size_human":"44.3 KB"
"content_type":"image/gif",
"checksum":"2900b619fa004ba8030195b70e661df1fe6d0480cab3dabc71634cd4679bde4b",
"crc32":"edac54e4",
"assembled":true,
"virus_scan_required":true,
"virus_scanned":true,
"virus_scanned_at":"2020-09-02T03:49:21.004Z",
"content_blocked":false,
"content_blocked_message":null,
"actionscript":null,
"actionscript_scanned_at":null,
"actionscript_scanned":false,
"processed":false,
"processed_at":null,
"expires_at":null,
"created_at":"2020-09-02T03:49:21.004Z",
"available":true
}
}