I am making an online tool for identifying certain types of files. I need to get some byte values ββfrom the file header to do this.
The user selects a file on the client machine. One way or another, I need to get the key byte values ββfrom the file, and then they will be found in the database on the server side to classify the file.
How can I read bytes from a client file?
I know that I could upload the file to the server, but these files are very large and I need only a few bytes, so it would be slow and wasteful to upload the whole file.
Can I somehow download part of the file? It seems difficult to cancel the loading of the html form, and after the cancellation, the file part is not available. Is it correct?
Can I read a file in javascript? I searched for this, but the answer is unclear. I read that this is possible with a java applet, but only if the subscriber is signed.
Is there another way?
source share