aboutsummaryrefslogtreecommitdiff
path: root/src/FileRouter.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/FileRouter.ts')
-rw-r--r--src/FileRouter.ts30
1 files changed, 11 insertions, 19 deletions
diff --git a/src/FileRouter.ts b/src/FileRouter.ts
index b4cd403..546c694 100644
--- a/src/FileRouter.ts
+++ b/src/FileRouter.ts
@@ -909,25 +909,17 @@ const postFilePath: Middleware = async(
}
} else {
if (req.query.overwrite) {
- if (req.query.truncate) {
- await saveFile(
- req.body,
- res.locals.project.name,
- res.locals.file.uuid,
- req.query
- );
- if (req.query.final) {
- res.locals.file.status = 'preprocessing';
- await res.locals.file.save();
- preprocess(res.locals.file, res.locals.project);
- }
- } else {
- logger.warn('overwriting without truncating not supported');
- return next(new RequestError(
- 500,
- 'not_implemented',
- 'please specify truncate parameter'
- ));
+ console.log("overwriting from offset " + (req.query.offset || 0))
+ await saveFile(
+ req.body,
+ res.locals.project.name,
+ res.locals.file.uuid,
+ req.query
+ );
+ if (req.query.final) {
+ res.locals.file.status = 'preprocessing';
+ await res.locals.file.save();
+ preprocess(res.locals.file, res.locals.project);
}
} else {
return next(new RequestError(400, 'file_already_exists'));