Sending dicom files to orthanc server from node js with axios

Hello, Good evening to you all.
When I send a dicom file from my node js backend with axios, I don’t get the expected JSON object in the response, I get an empty string yet when I check in my studies in orthanc server, the study is there. No errors, just no response.
Any help? Javascript geniuses.

This is my request;

Here is the response:
Screenshot 2024-07-26 002300

Response.data is the empty string. Yet without that response, I cannot connect a posted case to a particular user without the study id and other details that come as post orthanc response JSON object.
And the work has literally frozen. I need help please.

Hi,

This is because you’re sending the dicom file as a form encoded data. try sending it as raw binary data and you will get a json response. ie:


const dicom = await readFile("/path/to/dicom/file.dcm")
const response = await axios.post('/instances', dicom)

Hope that helps.

James

1 Like

Okay, thanks.
I will also try zipping the dicom files and sending as a zipped file from my backend, it was working with formdata but still with no response.
I hope it will give me expected results this time results.