Description
Regarding the JMAP specifications concerning downloading blobs : https://jmap.io/spec-core.html#downloading-binary-data
The JMAP draft version already manages the download of attachments and full messages, thus:
- Port download route from JMAP draft version.
- Make sure it works for full message and attachment
- Handle error:
+ Failed to Authenticate
+ No right to download
+ Resources not found
+ Parameters missing or wrong format
We need as well to propose an URL including the following parameters:
- *accountId*: The id of the account to which the record with the blobId belongs
- *blobId*: The blobId representing the data of the file to download
- *type*: The type for the server to set in the Content-Type header of the response; the blobId only represents the binary data and does not have a content-type innately associated with it
- *name*: The name for the file; the server MUST return this as the filename if it sets a Content-Disposition header
A proposed URL would be: `/download/$accountId/$blobId/?type=$type&name=$name`
DOD:
- Make sure it work for download full message or attachment
- Write integration test
- Update the session object with the new download URL