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

Time:03-23

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?

CodePudding user response:

Simply do this:

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

  • Related