Windows Universal file picker allows videos -


i have file input in app:

<input type="file" (change)="filechange($event)" placeholder="select gallery" accept=".png,.jpg,.jpeg"/>

this should allow .png .jpg or .jpeg files selected allows selection of files when running on windows universal platform. (windows 10 mobile).

is there way can force windows universal platform allow selection of images? or should catch after user has selected file?

is there way can force windows universal platform allow selection of images? or should catch after user has selected file?

instead of using filepicker of html, can use windows.storage.picers.fileopenpicker accomplish that:

html:

<!doctype html> <html> <head>     <meta charset="utf-8" />     <title>testfilepicker</title>     <link href="css/default.css" rel="stylesheet" /> </head> <body>     <div>content goes here!</div>     <button id="btnclick">click me pick file</button>     <script src="js/main.js"></script> </body> </html> 

main.js:

(function () { "use strict"      document.getelementbyid("btnclick").onclick = function (evt)     {         var openpicker = new windows.storage.pickers.fileopenpicker();         openpicker.viewmode = windows.storage.pickers.pickerviewmode.thumbnail;         openpicker.suggestedstartlocation = windows.storage.pickers.pickerlocationid.pictureslibrary;         openpicker.filetypefilter.replaceall([".png", ".jpg", ".jpeg"]);          // open picker user pick file         openpicker.picksinglefileasync().then(function (file) {             if (file) {                 // application has read/write access picked file             } else {                 // picker dismissed no selected file             }         });     } })(); 

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -