How to use the createReadStream function from fs-promise

Find comprehensive JavaScript fs-promise.createReadStream code examples handpicked from public code repositorys.

166
167
168
169
170
171
172
173
174
175
    const errorMessage = `File ${fileUuid} not found`;
    throw errorMessage;
  }
  const fileName = file.name;
  ctx.res.setHeader('Content-disposition', `attachment; filename=${fileName}`);
  ctx.body = fs.createReadStream(file.filePath);
} catch (ex) {
  ctx.status = 500;
  ctx.body = new Response(ctx, requestDescription, ex);
  logger.error(ex);
fork icon20
star icon26
watch icon0