search

Home  >  Q&A  >  body text

javascript - When using form elements in html5, when uploading files using input, if it is limited to image files, it will be very slow to open the file selection window.

The problem is this:
Use: <input type="file" id="file" multiple size="5" accept="image/*">
When selecting image files, if the accept attribute limit is not added, the file selection window will be opened very quickly, but after the accept limit is added, the file selection window will become very slow.

高洛峰高洛峰2707 days ago968

reply all(1)I'll reply

  • 怪我咯

    怪我咯2017-06-29 10:11:53

    Try the solution to specify MIME type

    <input type="file" accept="image/gif,image/jpeg,image/jpg,image/png,image/svg">

    reply
    0
  • Cancelreply