uint8 is an arrayBuffer created using reader.readAsArrayBuffer from an image file. The size of this arraybuffer is 30984. The size of the original image file is also 30984.
However, if you create a new file using this uint8, the capacity also increases, and it seems that a file other than an image file is created and uploaded. Looking at the captured image below, the size of the newly created file is 69596.
Why is this different? How can I create the same file?
The arrayBuffer argument needs to be an entry in an array passed to new File
as its first argument, as documented under bits
in MDN documentation.
Assuming uint8
is the arrayBuffer, the call would look like
var resultFile = new File([uint8], "test.jpg");
Please do not post code as images - it makes it difficult if not impossible for readers to explore the code or try it out.