For historical reasons, the value IDL attribute prefixes the file name with the string "C:\fakepath". Some legacy user agents actually included the full path (which was a security vulnerability). As a result of this, obtaining the file name from the value IDL attribute in a backwards-compatible way is non-trivial. The following function extracts the file name in a suitably compatible manner:
function extractFilename(path) { if (path.substr(0, 12) == "C:\fakepath\") return path.substr(12); // modern browser var x; x = path.lastIndexOf('/');