You can add an attachment to any record with a single PUT request to the prilohy sub-evidence. Below is an example of how to attach an image to a price list item using the cURL tool.
Command
curl -u uzivatel:heslo -k -L -X PUT \
-H "Content-Type: image/jpeg" \
-T "C:\obrazky\LAMPA1.jpg" \
"https://server:5434/c/{firma}/cenik/code:LAMPA1/prilohy/new/LAMPA1.jpg"
Individual parts of the command:
Command part | Meaning |
| The record to which the attachment is being added. Besides the internal ID, you can also use a code or external identifier — in that case you need to use |
| The last part of the address is saved as the attachment's file name (property |
| The file on disk that is sent as the request body. |
| The content type. If you don't specify it, the attachment will be saved with the type |
A successful upload returns 201. You can list a record's attachments at the address /c/{firma}/cenik/code:LAMPA1/prilohy.xml, and view the content of a specific attachment at /prilohy/{ID}/content.
📝 cURL is a freely available program — it comes built into Windows, macOS, and most Linux distributions. On Windows, be careful with backslashes in the path: they work inside double quotes, but in PowerShell it's safer to use regular forward slashes.
