This is an example file viewed in a hex editor: link I have a binary file on my computer that I want to upload and store as a JavaScript array. It doesn't matter if the final array is
thebytes = [0x00, 0x43, 0x41, 0x46, 0x45, 0x42, 0x41, 0x42, 0x45, 0xFF]
or
thebytes = [0, 67, 65, 70, 69, 66, 65, 66, 69, 255]
but it can't be any kind of ASCII or Unicode representation, I simply want the file's byte values to an array.
I've found numerous guides but they all either concentrate on text files or Strings generally or are ~5 years old and imply that it isn't possible with JS.
Related: a Codepen I'm trying to implement it into. The first variable is "thebytes" and contains a boatload of bytes, manually formatted and inserted. This is what I'm trying to avert - I just need a method of pushing "Choose file" and "OK" so I don't have to jump between a hex editor, a text editor and Codepen.
Thanks.