2

Is there a way to specify the file types which can be accepted by HTML File Input/Upload dialog?

<input type="file" value="Upload XML file"/>

I wish to control that only certain file types are visible in the dialog based on their extensions.

1 Answer 1

1

Take a look at this answer -> File input 'accept' attribute - is it useful?

The accept attribute of input element was meant to provide mime-type filtering, however whilst the accept attribute exists within the RFC 1867, it would appear that the majority of browsers do not use this.

You will have to look for a JavaScript / Flash alternative, as suggested in the referenced post.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.