Loading files in a browser does not provide scripting script for JavaScript.
Typically, this is done with an AJAX call to the server, which then sends data based on the server's file upload status (which can be scripted). I don't think it can only be done on the client side.
source
to share