TIL:

You can create virtual files in JS and add them to a file input, but you can't set the value or files properties directly.

You need to use a DataTransfer object.

Of course, if you're going to submit the input in a form anyway, you could always just append the file to a FormData object