From 36c7a4cf35d52f0ae49782f2e691b2bc835c1993 Mon Sep 17 00:00:00 2001 From: daniel-j Date: Fri, 19 Jan 2024 17:12:58 +0100 Subject: [PATCH] add application/epub as extra type --- index.js | 4 ++++ static/upload.html | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 1b78172..994e77f 100644 --- a/index.js +++ b/index.js @@ -240,6 +240,10 @@ router.post('/upload', upload.single('file'), async ctx => { mimetype = type.mime } + if (mimetype == "application/epub") { + mimetype = TYPE_EPUB + } + if ((!type || !allowedTypes.includes(type.mime)) && !allowedTypes.includes(mimetype)) { flash(ctx, { message: 'Uploaded file is of an invalid type: ' + ctx.request.file.originalname + ' (' + (type? type.mime : 'unknown mimetype') + ')', diff --git a/static/upload.html b/static/upload.html index 7dd7dc2..9f53880 100644 --- a/static/upload.html +++ b/static/upload.html @@ -15,7 +15,7 @@
- +

EPUB, MOBI, PDF,
TXT, CBZ, CBR



EPUB, MOBI, PDF,
TXT, CBZ, CBR