From 464991b62e4fa6141449ca0c5980fcf0af3097a6 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 23 Feb 2021 20:31:19 +0100 Subject: upload files and write to disk --- app/node_modules/okservices/oks3/index.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'app/node_modules/okservices/oks3/index.js') diff --git a/app/node_modules/okservices/oks3/index.js b/app/node_modules/okservices/oks3/index.js index 41ee3dc..60567e9 100644 --- a/app/node_modules/okservices/oks3/index.js +++ b/app/node_modules/okservices/oks3/index.js @@ -46,6 +46,7 @@ function OKS3(options) { key: options.s3.key, secret: options.s3.secret, bucket: options.s3.bucket, + local: options.s3.local, }) var express = options.express; @@ -85,7 +86,7 @@ function OKS3(options) { router.post('/audio', mult.single('audio'), function(req, res) { d.run(function () { - if (! options.s3.image.allowed) { + if (! options.s3.audio.allowed) { return res.status(500).json({ error: "Audio uploading not permitted" }) } @@ -113,7 +114,7 @@ function OKS3(options) { router.post('/video', mult.single('video'), function(req, res) { d.run(function () { - if (! options.s3.image.allowed) { + if (! options.s3.video.allowed) { return res.status(500).json({ error: "Video uploading not permitted" }) } @@ -140,7 +141,7 @@ function OKS3(options) { router.post('/file', mult.single('file'), function(req, res) { d.run(function () { - if (! options.s3.image.allowed) { + if (! options.s3.file.allowed) { return res.status(500).json({ error: "File uploading not permitted" }) } @@ -149,6 +150,10 @@ function OKS3(options) { preserveFilename: options.s3.video.preserveFilename, dirname: options.s3.dirname, types: { + 'image/gif': 'gif', + 'image/jpeg': 'jpg', + 'image/jpg': 'jpg', + 'image/png': 'png', 'application/pdf': 'pdf', 'text/plain': 'txt', 'text/html': 'html', -- cgit v1.2.3-70-g09d2