Skip to content

Retrieving Files

Terry Brady edited this page Jun 22, 2021 · 3 revisions

Merritt File download requests are handled by creating a presigned URL to the file in cloud storage. This feature is implemented across each of the cloud storage providers utilized by Merritt.

File retrieval links in the Merritt User Interface make use of this retrieval mechanism.

Presigned URL's have an expiration time. Once the expiration time has passed, a new presigned URL will need to be generated for access.

File Retrieval request

GET https://merritt.cdlib.org/api/presign-file/{ObjectArk}/{ObjectVersion}/{FilePath}
  • {ObjectArk} - Url-encoded representation of the Object Ark containing the file to be retrieved
  • {ObjectVersion} - Version number containing the file to be retrieved
  • {FilePath} - Url-encoded representation of the path to the file within the object

Optional Parameters

  • no_redirect
    • if "true", the presigned url will be sent in a json payload rather than in a redirect header
  • contentDisposition=attachement (optional)
    • This flag controls whether to display the retrieved file in the browser or download the file as an attachment.

File retrieval response

The request should return a 303 or 200 response.

Response Status 303, Redirect user to presigned URL

The value of the location response header can be used to redirect the user to the presigned url to access the file.

Response Status 200, Presigned URL in response payload