JSFiddle - React, Tailwind, and code Playground

HTML

<form name="form5" id="form1" enctype="multipart/form-data" method="post" action="Upload.aspx">
    <div>
        <input type="file" name="fileToUpload" id="fileToUpload" onchange="fileSelected();" accept="image/*" capture="camera" />
    </div>

</form>
<button id="abrir">Abrir janela</button>

JavaScript

$('#abrir').on('click', function() {
    $('#fileToUpload').trigger('click');
});