CORS issue while trying to download Binary resourc...
# support
k
I am encountering a CORS issue whenever trying to use `medplum.download`with the Binary URL reference. Currently the workaround I am using is parsing the URL string to extract the Binary reference (i.e
Binary/1234
) and then passing that into
medplum.download
. The docs say we should be able to download the blob with either the URL or the Binary reference. Please advise!
r
HI @kwillard95 , sorry for the confusion here. This needs to be documented better, potentially with some helper functions. The short answer is that if you are operating in the browser, you are doing the right thing by parsing out the Binary reference to avoid CORS issues
The download examples in the docs are written from the perspective of Bots, that don't have CORS restrictions
We'll take a follow up action to clarify these CORS workaround, as well as generate some utility functions to help with this. But I wanted to confirm @kwillard95 - are you unblocked?
k
Yes I am - thank you for clarifying @rahul1 !
130 Views