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