Add attachment to a task by API
TaskAttachment taskAttachment = new TaskAttachment();
taskAttachment.setContentType("image/jpeg"); // Mime type
taskAttachment.setName("photo.jpg"); // Nom du fichier
// Lecture des données en format binaire en mémoire
RandomAccessFile f = new RandomAccessFile("/path/to/file", "r");
byte[] data = new byte[(int)f.length()];
f.read(data);
taskAttachment.setSize(data.length);
taskAttachment.setData(data);
CreateRecordRequest request = new CreateRecordRequest();
request.setCredentials(credentials);
request.setParentRecordRef(taskRecordRef); // RecordRef qui référence une tâche existante
request.setRecord(taskAttachment);
progressionWebService.createRecord(request);