There is a HTML 5 File API which you can use to read files without uploading: https://www.html5rocks.com/en/tutorials/file/dndfiles/
I improved usability by reducing it to one input text field and two buttons for two functionalities. On the front end I used "formaction" attribute in buttons instead of "action" attribute in the form. So I reduced everything into one form. In the backend, it was a bit more complicated. I needed to differentiate between different types of input and gather different classes of the two functionalities into one class. This helped remove code duplicates and made the code easier to understand. In the end, the usability of the web page improved greatly and the backend code was also improved.