Home > Enterprise >  React: input type "file" ignores `accept` property when you upload files using drag and dr
React: input type "file" ignores `accept` property when you upload files using drag and dr

Time:12-16

I use <input type="file" accept=".txt" /> with accept property. I set it to accept, for example, only .txt files. And it works well if you click on input and opens the chooser and you cannot upload files that not allowed by accept.

But, when you upload files by drag & drop it uploads any files ignoring accept.

Here is an example: Edit kind-jennings-t8947

  • Related