2024-05-01 09:52:12 -04:00
|
|
|
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,
|
2024-06-12 04:27:13 -04:00
|
|
|
buildId
|
2024-05-01 09:52:12 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
res.attachment('output.zip')
|
|
|
|
res.setHeader('X-Content-Type-Options', 'nosniff')
|
|
|
|
archive.pipe(res)
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = { createOutputZip: expressify(createOutputZip) }
|