Hello gents,
curl https://mydomain:8042/studies/aa0c1457-b51c6cba-c5bac6fd-65a596c1-b70db111/attachments/reportPdf -X PUT --data-binary @/etc/orthanc/ClientRpts/Sumalia01/20240606210238_Sumalia01.pdf
This command works perfect!
However when I tried to make it into Lua script
local attachmenName = ‘/etc/orthanc/ClientRpts/Sumalia01/20240606210238_Sumalia01.pdf’
local studyId = ‘aa0c1457-b51c6cba-c5bac6fd-65a596c1-b70db111’
UploadAttachment(studyId, attachmenName)
function UploadAttachment(studyId, attachmenName)
local studyAttachmentUrl = ‘/studies/’ … studyId … ‘/attachments/reportPdf’
local payload = attachmenName
RestApiPut(studyAttachmentUrl, payload, true)
end
It doesn’t work.
Thanks in advance