Instead of using an `input type="file"` html tag, is it possible to bring up a `choose a file to upload` dialog box by clicking a `input type="button"`? Then when a file is selected from the `choose a file to upload` dialog box, the file path gets inserted into a regular html `input type="text"` tag?

I've seem that gmail does something similar but not with buttons and text inputs, they simply have a link `add file` or something like that. When that link is clicked, it shows the `select file(s) to upload by mail.google.com` dialog box. When a file is clicked, the file name is shown on the screen.

How are they doing that?