user3315336 user3315336 - 4 months ago 9x
jQuery Question

How to upload a photo from mobile using input tag(type = file)?

Is there any way to upload only photos using input tag? or any other

<input type="file" accept="file_extension">

the accept file_extension can be :

  • audio/* All sound files are accepted
  • video/* All video files are accepted
  • image/* All image files are accepted
  • media_type A valid media type, with no parameters. Look at IANA Media Types for a complete list of standard media types

What you want is

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

I just search "upload file html input" on google.