Which is correct: "Filename", "File Name" or "FileName"?
The original form of the word was "file name", as in the name of a file. These days (and probably for a good few years), the compound "filename" is widely accepted and perhaps most commonly used. Either is of course perfectly acceptable.
Do not, however, capitalise letters in the middle of a word, under any circumstances. (Unless you are writing variable names in code.)
Filename is in my experience the most common and in my opinion the best looking. File name is also acceptable, but I would only use it rarely, perhaps in a parallel construction such as the file name and size. I find word-medial capital letters distracting and unpleasant anywhere but program source code, so I would never even think of FileName. Edit: if that's the reason you're asking, in program source I would still use
Filename for a class or
filename for a variable, not
The British National Corpus has 240 cites for filename and 72 cites for file name. It's not possible to search case-sensitively, but several reloads of the random sample of specific entries gave me no matches for FileName.
The AHD has an entry for “filename”, so it is, at least, an established American English word. Thus it is “correct” for some situations.
Update: the word “pathname” is also included in the American Heritage Dictionary: Fifth Edition. So over time I will be changing my program variables from SettingFilePathName to SettingFilePathname.
Any two words (such as 'file name') used together for long enough periods of time end up with a single meaning in our collective language. When that happens, you can combine the two, though it's not advisable for formal usage. Words such as, for example, 'himself' are older, and common examples from the computer age include 'username', 'email', and 'desktop'.
For formal usage, consider spacing the words or using a hyphen, where appropriate.