Landing page metadata export as file download with name
tags: ["landing pages", "metadata"]
Currently, the metadata download on landing pages sends a basic requests, then, based on the response, the browser decides what to do. What typically happens is one of the following cases (tested with Firefox):
- The browser recognizes the content type and displays the response (DataCite JSON, JSON-LD, RDF XML)
- The browser doesn't recognize the content type and saves the response as a plain text file with random name (DataCite XML)
- The browser recognizes the content type but can't display it and saves the file with a random name but correct file extension (Turtle, N-Triples)
Instead, every format should be handled as a download and specify a meaningful file name, e.g. based on digital object ID (H1234.nt
).
For reference: https://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement/download