'How to remove internet shortcuts from HTML's input file selection?

When I make standard HTML file input like so: <input type="file" id="pdf" accept="application/pdf" /> the file selection contains not only PDF files, but also "Internet Shortcut" files. if i choose these I get "Catastrophic failure" error. How can I get rid of this behaviour using html/react?

You can try it yourself in this Codesandbox

EDIT 1:

I'm also sure its Windows problem, but I'm still unable to fix it in html/javascript. another description here.



Solution 1:[1]

I would filter the files server side, because there are tools, such as Live HTTP Headers on Firefox that would allow to upload any file, including a shell. People could hack your site. Do it server site, to be safe.

copied from How to remove internet shortcuts from HTML's input file selection? with thanks to https://stackoverflow.com/users/1283825/alexandre-hitchcox

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Grumpy