Solution 1 :

Try this for JS.

    <form action="">
    <label for="file">Select file:</label>
    <input type="file" name="file" accept="text/js">
    </form>

Info on accept

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#attr-accept

Configuring server MIME types

https://developer.mozilla.org/en-US/docs/Learn/Server-side/Configuring_server_MIME_types

MIME types

https://www.sitepoint.com/mime-types-complete-list/

Problem :

HTML input type=”file” event doesn’t detect ttf, otf, or js, how do I change that? I would like to have mime types working from the start.

Comments

Comment posted by Quinn Keaveney

I’m not looking to support accept. I want ttf and otf to be reflected in the mime type.

Comment posted by developer.mozilla.org/en-US/docs/Learn/Server-side/…

developer.mozilla.org/en-US/docs/Learn/Server-side/…

By