I found out after testing that linux allows any character in a file name except for / and null (\\0). So what sequence should I not allow in a file
/
\\0
urlencode all strings to be use as filenames and you'll only have to worry about length. This answer might be worth reading.