Is There Any Jquery Plugin That Will Restrict A Html File Uploader Only To Accept Images
I saw a lot of file up loader plugins .I dont want to use the entire file upload plugin .. Means , I am using my own code. But i didnt find a way to restrict the file type the upl
Solution 1:
This requires HTML5, jQuery is not needed. I think it will be small enough to use pure JavaScript:
- first you can set the accept attribute to
image/*
- after that you can use the File Api to read the first bytes for the magic number - image numbers demo
These are just some ideas. You can devise some heuristic to check the file type based on this.
Post a Comment for "Is There Any Jquery Plugin That Will Restrict A Html File Uploader Only To Accept Images"