-
Notifications
You must be signed in to change notification settings - Fork 4
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.
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
-
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.
The request should return a 303 or 200 response.
The value of the location response header can be used to redirect the user to the presigned url to access the file.