From acd2cd460ef781ba5ae37d579ac984ca4ee1948c Mon Sep 17 00:00:00 2001 From: Hafeez Date: Sun, 15 Apr 2018 19:44:38 +0100 Subject: file upload works, i thnk --- src/FileRouter.ts | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/FileRouter.ts b/src/FileRouter.ts index d6cea53..9a7dcac 100644 --- a/src/FileRouter.ts +++ b/src/FileRouter.ts @@ -575,19 +575,8 @@ const postFilePath: Middleware = ( name: res.locals.filename, parentFolder: res.locals.parentFolder }); - console.log(res.locals); - /* - console.log("1: " + file.uuid + " -- " + res.locals.project.name) - try { - let x = files.writableStream(file.uuid, res.locals.project.name); - console.log("2") - req.pipe(x); - console.log("3") - } catch (err) { - console.log(err); - } - console.log("4") - */ + //console.log(res.locals); + req.pipe(files.writableStream(file.uuid, res.locals.project.name)); next(); }; @@ -714,13 +703,14 @@ export class FileRouter { } const parentFolder: File | null = await File.findOne({ include: [ - { model: File, as: 'containedFiles' } + { model: File, as: 'containedFilesInternal'}, ], where: { - parentFolder: file, - name: fileNames[0] + //parentFolder: file, + //name: fileNames[0] } }); + //console.log(parentFolder); if (parentFolder == null) { return next(); } -- cgit v1.2.1