diff --git a/core/server/web/api/middleware/upload.js b/core/server/web/api/middleware/upload.js index bcc476e9c6..462b656550 100644 --- a/core/server/web/api/middleware/upload.js +++ b/core/server/web/api/middleware/upload.js @@ -199,7 +199,7 @@ const mediaValidation = function ({type}) { req.thumbnail = thumbnailFile; req.thumbnail.ext = path.extname(thumbnailFile.originalname).toLowerCase(); - req.thumbnail.name = path.basename(req.file.name, path.extname(req.file.name)) + req.thumbnail.ext; + req.thumbnail.name = `${path.basename(req.file.name, path.extname(req.file.name))}_thumb${req.thumbnail.ext}`; req.thumbnail.type = req.thumbnail.mimetype; if (!checkFileIsValid(req.file, contentTypes, extensions)) { diff --git a/test/e2e-api/admin/media.test.js b/test/e2e-api/admin/media.test.js index 54bfeefc8c..5f70ae3dfb 100644 --- a/test/e2e-api/admin/media.test.js +++ b/test/e2e-api/admin/media.test.js @@ -34,7 +34,7 @@ describe('Media API', function () { .expect(201); res.body.media[0].url.should.match(new RegExp(`${config.get('url')}/content/media/\\d+/\\d+/sample_640x360.mp4`)); - res.body.media[0].thumbnail_url.should.match(new RegExp(`${config.get('url')}/content/media/\\d+/\\d+/sample_640x360.png`)); + res.body.media[0].thumbnail_url.should.match(new RegExp(`${config.get('url')}/content/media/\\d+/\\d+/sample_640x360_thumb.png`)); res.body.media[0].ref.should.equal('https://ghost.org/sample_640x360.mp4'); media.push(res.body.media[0].url.replace(config.get('url'), ''));