Search code examples
visual-studio-2012microsoft-metrowinjswindows-8.1file-io

How to filter file types in input type="file" in WinJS


I have an Metro app (WinJS) in VS2012 where I am using an input type like this one:

<input type = "file" id = "uploadCaptureInputFile"  />

and I want to filter the files, for accepting just .png and .jpg how to do that


Solution

  • with this:

    <input type = "file" id = "uploadCaptureInputFile" accept="image/*" />