My filenaming convention is "TrackID ArtistName - TrackTitle.mp3" renamed from whatever the uploaded files' original names were using user info and the TrackTitle entered in the upload form. Up until now my HTML charset has been undeclared and I am now switching it to utf8. So I will be using
Code: Select all
$filename = utf8_accents_to_ascii($filename);
$filename = utf8_strip_non_ascii($filename);I alos know DOS/Windows will reject the following characters \ / : * ? " < > |
From what I can tell Apache will let you do whatever you want. If you have a backslash (/) in the filename it will just create necessary folders to make it work and the file is still accessible in that way.
I don't know anything about the Mac platform.
To negate the invalid ascii characters I came up with this --
Code: Select all
function DOSfriendly($filename) {
$filename = str_replace(array("\\","/",":","*","?",'"',"<",">","|"),
array( "µ","¶","~","¤","¿","¨","(",")","I"),$filename);
return $filename;
}Any feedback on this concept would be appreciated!