mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-24 21:12:38 -04:00
1409e32010
GitOrigin-RevId: 71a28a0215c5f1a6975c9e2fcdcd476513df1cbc
22 lines
560 B
JavaScript
22 lines
560 B
JavaScript
const OutputFileArchiveManager = require('./OutputFileArchiveManager')
|
|
const { expressify } = require('@overleaf/promise-utils')
|
|
|
|
async function createOutputZip(req, res) {
|
|
const {
|
|
project_id: projectId,
|
|
user_id: userId,
|
|
build_id: buildId,
|
|
} = req.params
|
|
|
|
const archive = await OutputFileArchiveManager.archiveFilesForBuild(
|
|
projectId,
|
|
userId,
|
|
buildId
|
|
)
|
|
|
|
res.attachment('output.zip')
|
|
res.setHeader('X-Content-Type-Options', 'nosniff')
|
|
archive.pipe(res)
|
|
}
|
|
|
|
module.exports = { createOutputZip: expressify(createOutputZip) }
|