[Bug 12213] Provide a note explaining the history of the "fakepath" stuff so people don't go WTF

http://www.w3.org/Bugs/Public/show_bug.cgi?id=12213

Aryeh Gregor <Simetrical+w3cbug@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |Simetrical+w3cbug@gmail.com
            Summary|What!? Is this a joke, if I |Provide a note explaining
                   |get the value of an input   |the history of the
                   |element in 'filename' mode, |"fakepath" stuff so people
                   |I get the filename with an  |don't go WTF
                   |extra string prepended to   |
                   |it, so that to use the      |
                   |filename I will always have |
                   |to strip the first 12       |
                   |characters? That is really  |
                   |messed up.                  |

--- Comment #2 from Aryeh Gregor <Simetrical+w3cbug@gmail.com> 2011-03-02 00:30:26 UTC ---
Since the original bug filer didn't make an actual request, I've taken the
liberty of interpreting this as "add a note explaining the fakepath stuff". 
The gist of it is that browsers originally returned the full path, but then
decided that was a security vulnerability so they only wanted to return the
filename, but by then there were lots of sites that would break if they didn't
get a full Windows path, so browsers had to provide a fake path instead. 
Typical web platform insanity.

The note should also point out that you can do input.files[0].name or whatever
instead of input.value, to avoid having to strip the path (although this might
not work yet in all browsers?).

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Wednesday, 2 March 2011 00:30:28 UTC