Forum Moderators: phranque
I can check the domain no problem (less than 26 characters, begins with an alphanumeric etc but I'm not sure what constitutes a valid filename.
Anyone know of the magic answer, or the RFC mentioning this area?
Bear in mind a valid file name is not the same as a valid URL.
What is acceptable for a file name varies across systems: MAC. Win, Unix, etc.... as does what is seen as a different file name (WIN folds letters; UNIX is usually case sensitive).
It's a minefield of cross-platform niggles.
If you can restrict the file names to lowercase letters, digits, hyphens (though not leading, just in case) and perhaps the odd period, you should work almost anywhere.
I was just trying to narrow down wasted HTTP requests to URL's that would inevitable return an error.
> lowercase letters
If I remember right IIS treats URI's case-insensitive while apache is sensitive..(or maybe windows/unix systems, yeah thats it i think).... a minefield as you say ;)
I'll make a check to remove non-printable characters and escape the string, I guess that will be enough for the script to run without an error.
Cheers!
The *nix filesystem is case-sensitive, but URIs on web servers on *nix systems are not necessarilly case-sensitive. For example, Apache servers with mod-speling [httpd.apache.org] (yes, it only has one "l") enabled (most have it disabled by default) make URIs case-insensitive (and check for spelling errors).