Settings and activity
5 results found
-
20 votes
Currently the file name does accept using a dash, full stop and underscore however does not allow for commas. We are discussing this with our development team
Tom Fraser supported this idea ·An error occurred while saving the comment -
15 votesTom Fraser supported this idea ·
-
9 votesTom Fraser supported this idea ·
-
5 votesTom Fraser shared this idea ·
-
3 votesTom Fraser shared this idea ·
//This may work on the client side. It also happens when attaching when attaching documents in emails.
function sanitizeFileName(fileName) {
// Replace all invalid characters with an underscore
return fileName.replace(/[,\s]/g, '_');
}
document.getElementById('fileInput').addEventListener('change', function(event) {
let file = event.target.files[0];
let sanitizedFileName = sanitizeFileName(file.name);
// Here you would set the sanitized file name to the file input or handle accordingly
console.log('Sanitized file name:', sanitizedFileName);
});