Ecnalyr
Ecnalyr

Reputation: 5802

I want users browsing from an iPhone to have the option to upload only a video or an image, not both

I have two forms on a website.

When a user clicks the button to attach a file to the form, the user is always given the two options:


Vimeo restricted this file attachment feature somehow to be restricted to just enable video uploads (in the past, they seem to have limited their mobile functionality recently). A user would see the following two options:


How can I make the user only able to select files of the appropriate file type when attaching a file to a form?

Upvotes: 1

Views: 440

Answers (1)

neilco
neilco

Reputation: 8012

To restrict the media types that a file input will take, you can use the accept attribute.

For images only:

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

For video only:

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

Upvotes: 1

Related Questions