Alfred Huang
Alfred Huang

Reputation: 18235

How to restrict the html upload file type to *.xmind?

Now I'm developing on an html page which wants to upload an XMind file (with extension name *.xmind).

I'm now making an <input type="file" /> element to upload the file.

But the accept type cannot restrict to the file type *.xmind, is there any solutions?


My effort:

Using accept="application/pdf" attribute can restrict the file type to *.pdf.

I searched about the MIME type of *.xmind, seemed to be application/x-xmind (Ref: https://www.digipres.org/formats/mime-types/).

But using accept="application/x-xmind" attribute is not working.

Any ideas?

Upvotes: 0

Views: 176

Answers (1)

Zheng Bowen
Zheng Bowen

Reputation: 409

Simply do this:

<input type="file" accept=".xmind">

Upvotes: 1

Related Questions