From 3f132479d948518563857c6aacc0333a851ff688 Mon Sep 17 00:00:00 2001 From: benptc Date: Mon, 17 Jul 2023 11:10:44 -0400 Subject: [PATCH] fixup --- controllers/object.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/controllers/object.js b/controllers/object.js index ee05c4ae7..dddb6665c 100644 --- a/controllers/object.js +++ b/controllers/object.js @@ -93,6 +93,8 @@ const uploadVideo = function(objectID, videoID, reqForForm, callback) { } }; +// takes a filename (plus extension) and removes special characters and +// anything non-alphanumeric other than hyphens, underscores, periods function simplifyFilename(filename) { // Remove any special characters and replace them with hyphens filename = filename.replace(/[^\w\s.-]/g, '-'); @@ -128,7 +130,7 @@ function uploadMediaFile(objectID, req, callback) { let form = new formidable.IncomingForm({ uploadDir: mediaDir, - keepExtensions: true, + keepExtensions: true // accept: 'image/jpeg' // we don't include this anymore, because any filetype can be uploaded });