36
Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

posted at

html5 <input type='file' … で、選択可能なファイルを指定する

accept属性を指定する

●MIME指定

<input type='file' accept='image/jpeg'>

●形式問わない場合

<input type='file' accept="image/*">

●拡張子指定

accept=".jpg,.gif,.png,image/gif,image/jpeg,image/png"

Register as a new user and use Qiita more conveniently

  1. You can follow users and tags
  2. you can stock useful information
  3. You can make editorial suggestions for articles
What you can do with signing up
36
Help us understand the problem. What are the problem?