Remove all special characters so a string can be used as valid filename
// Replace all special characters with empty string
var filename = stringToFilter.replace(/[^\w\s\-\.]/gi, '')
// ^ Negation
// \w alpha numeric
// \s spaces
// /gi search global and case insensitive