Get file path in Firefox 3 - revisited
Because my previous entry on the subject is one of the most popular entries in my blog, yet the solution is not satisfactory (you have to get your users to mess with about:config), i decided to take a second look at the problem.
Just as a reminder: in Firefox 3 when you try to access a file input’s value property, it only gives you the filename, whereas earlier versions (and some other browsers at the moment) would give you the full path.
Firefox team considers this as a security patch and there is a fair chance that IE8 (and ultimately other browsers) will have the same behavior.
There is a lot of discussion about this here and here, and apparently a lot of applications have been relying on this feature. (The above links are bug reports, try to refrain from useless comments)
A new approach to the problem lies in Adam Fisk’s comment here. We can use a java applet to get the file path! The solution is working at the moment in all major browsers (demo here), but it might also be disabled in the future. Another problem is that because it completely avoids using the file input, you will still need to have your applet to do the actual upload. If you only need the path, you are fine, but if you need the path AND the file on the server side, you will need some more programming.
This is an archive post. It represents a point of view in the past. Facts might have changed, events might be interpreted differently as of today. Links might be broken.