[whatwg] "C:\fakepath\" in HTML5

Boris Zbarsky bzbarsky at MIT.EDU
Tue Mar 24 07:11:52 PDT 2009


Lachlan Hunt wrote:
> https://www.freedfm.com/
> 
> Specifically, the following code:
> 
> if((strFileName.indexOf("\\") == -1) && (strFileName.indexOf("/") == -1))
> {
>   alert("Please do not type your filename. Click Browse and upload your 
> zip file.");
>   document.fileupload.UploadFileData.focus();
>   return false;   
> }

I just tried this in a current Firefox.  The site worksforme, if we're 
talking about the ZIP upload on the front page.

The code you mentioned is commented out in their JS, like so:

   /* KRC 6/19/2008 #8234
   ...
   */

They still have various other silly checks (like requiring a filename 
that's at least 6 characters long without telling the user that's what 
they require), but that's not really relevant to this discussion.

-Boris



More information about the whatwg mailing list