I would like to automatically click the fileToUpload button when loading the page, in the following code:
<body>
<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>
<div>
<input type="button" onclick="uploadFile()" value="Upload" />
</div>
</form>
<!-- fiz esse código abaixo mas não funciona-->
<script type="text/javascript">
document.form5.getElementById("fileToUpload").click();
</script>
</body>