Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
benptc committed Jul 17, 2023
1 parent fec7148 commit 3f13247
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion controllers/object.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, '-');
Expand Down Expand Up @@ -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
});

Expand Down

0 comments on commit 3f13247

Please sign in to comment.