You can use the html attributes for this.
You would give the actual file uploader an id of „example“ and the custom button the attribute „for“ „example“ . Last you can hide the actual file uploader because when you click on your custom button it triggers the file uploader