Thursday, May 16, 2019

Input type file accepts MS presentations

In html5, input tag has a property called accept to filter the kind of files. If we want to filter just power point files, we should do something like as follow:


<input id="media-file-upload"
class="input-upload"
type="file"
nv-file-select=""
uploader="mediaListCtrl.uploader"
accept="application/vnd.ms-powerpoint,
application/vnd.openxmlformats-officedocument.presentationml.slideshow,
application/vnd.openxmlformats-officedocument.presentationml.presentation"
multiple/>
view raw filter.html hosted with ❤ by GitHub
With this, we are filtering .ppt, pptx and ppsx

But there is a trick xD
Look at the next screenshot:




Easy, right?

Happy coding! :)


No comments:

Post a Comment