I'm building a functionality in which a user is able to upload a certain type of file to a web server I'm building. This type of file contains an header of 8 bytes with various information, so before proceeding with the upload of the full file (the size is pretty big) I'd like to read that 8 bytes of the file so that the user can decide if continuing with the upload or not.
Currently I'm handling the file selection via an <input>
of type file
and I already have a callback that is called whenever a file is selected, but I don't know how to "upload" and only read the first bytes of the file.
Thanks in advance.