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);
20
26
0
fs-promise.writeJson is the most popular function in fs-promise (6458 examples)