This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Fetch a file from s3 as a Stream | |
| * | |
| * @param fileId the fileId to fetch | |
| * @return {stream: Stream, meta, contentType, contentLength} | |
| */ | |
| export async function fetchStream({ fileId }) { | |
| try { | |
| const key = makeS3Key(fileId); | |
| const fileOpts = { Bucket: BUCKET, Key: key }; | |
| const { stream, data } = await Promise.props({ |
OlderNewer