Download studies using the GET /studies/:id/archive API

Hi everyone!

I want to download a specific study from a react app whenever I click a download button. The problem I am facing right now is that the Orthanc server throws a CORS error when I try to make a request.

I would really appreciate it if someone provides me with appropriate request headers and configuration required on the orthanc.json file.

Regards,
Yash

P.S.
I have tried disabling cors in orthanc.json like this

“Cors”: {
“Enabled”: false,

}

And also tried this

“Cors”: {
“Enabled”: true,
“AllowOrigin”: [“*”],
“AllowMethods”: [“GET”, “PUT”, “POST”, “DELETE”],
“AllowCredentials”: true,
“AllowHeaders”: [“Content-Type”, “Authorization”, “X-Requested-With”]
}

Hi Yash,

It is not possible to enable CORS in Orthanc. The “solution” is to run orthanc on the same domain as your web application: https://book.orthanc-server.com/faq/nginx.html#enabling-cors.

Best regards,

Alain.