user3315336 user3315336 - 1 year ago 177
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

Answer Source
<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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download