diff --git a/download.html b/download.html index eed5355..2f7ed8c 100644 --- a/download.html +++ b/download.html @@ -4,7 +4,7 @@ Send to Kobo/Kindle - + @@ -12,25 +12,40 @@

Send to Kobo/Kindle

-
Unique key:
-
––––
+
Unique key:
+
+ –––– + +
+
+
+ +
+
Downloads
+
+

-
-


-
- +
+ Visit this on other devices to send ebooks to this ereader:
https://send.djazz.se
+
+ Created by djazz. Source code on Github
diff --git a/index.js b/index.js index 0671bc6..92f7387 100644 --- a/index.js +++ b/index.js @@ -97,7 +97,7 @@ const upload = multer({ cb(null, false) return } - if (!allowedTypes.includes(file.mimetype) || !allowedExtensions.includes(extname(file.originalname.toLowerCase()).substr(1))) { + if (!allowedTypes.includes(file.mimetype) || !allowedExtensions.includes(extname(file.originalname.toLowerCase()).substring(1))) { console.error('FileFilter: File is of an invalid type ', file) cb(null, false) return @@ -198,7 +198,7 @@ router.post('/upload', upload.single('file'), async ctx => { const type = await FileType.fromFile(ctx.request.file.path) - if (!type || !allowedTypes.includes(type.mime)) { + 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') + ')', success: false, diff --git a/style.css b/style.css index b582758..30779fd 100644 --- a/style.css +++ b/style.css @@ -14,14 +14,15 @@ h1 { font-weight: normal; font-style: italic; } -#key { +#keyoutput { font-size: 5em; - display: block; + display: inline-block; letter-spacing: 0.2em; margin: 10px 0; - font-family: sans-serif; + font-family: monospace, sans-serif; white-space: nowrap; text-transform: uppercase; + vertical-align: middle; } .center { text-align: center; @@ -39,11 +40,23 @@ h1 { display: inline-block; font-family: inherit; font-size: 1.2em; + margin: 0 0.5em; + vertical-align: middle; +} +#keygen { + margin-left: 1em; + margin-right: -4.7em; + padding: 1em; } #keygen:focus { background: black; color: white; } +#keygen svg { + display: block; + width: 1.5em; + height: 1.5em; +} #downloads { display: none; } diff --git a/upload.html b/upload.html index a047c70..2d1699b 100644 --- a/upload.html +++ b/upload.html @@ -14,7 +14,7 @@
- + @@ -33,30 +33,36 @@ Source code on Github - https://send.djazz.se +