downloading a file from api on another domain using anchor tag

Viewed 19

I have an api endpoint that fetches data about a file, the response has the file url and the name of the file. I am adding this url to an anchor tag:

<a href={file_url} download>download</a>

upon clicking the link, it initiates a download with "Failed - No file"

the file endpoint returns a Content-disposition header = inline; filename*=UTF-8''nameoffile.pdf

what am i doing wrong? why doesnt it download it?

0 Answers
Related