You can't get the file size of local files with javascript in a standard way using a web browser.
But if the file is accessible from a remote path, you might be able to send a HEAD request using Javascript, and read the Content-length header, depending on the webserver