Let's say I have this element on the page: This will create a button that allows the users of the web page to select a file via an OS 'File open.' Dialog in the browser. Let's say the user clicks said button, selects a file in the dialog, then clicks the 'Ok' button to close the dialog. The selected file name is now stored in: document.getElementById('image-file').value Now, let's say that the server handles multi-part POSTs at the URL '/upload/image'.
Jun 2, 2018 - Works with any server-side platform (PHP, Python, Ruby on Rails, Java, Node.js, Go etc.) that supports standard HTML form file uploads. Firefox 3 introduced a new API, that few people know about, which allows JavaScript to read local files selected by an user from a form file-upload dialog. A copy of Firefox 3 with default settings offers full access to this new programming interface.
How do I send the file to '/upload/image'? Also, how do I listen for notification that the file is finished uploading?