This repository has been archived by the owner on Feb 12, 2024. It is now read-only.
Storing Uint8Array data to IPFS changes data when getting the same data #1282
Labels
kind/support
A question or request for support
Type:
Problem
Severity:
High
Description:
I am trying to store an image to IPFS from my nodejs Server, The image is represented with an Uint8Array sent from my angular5 Client so basically :
WebClient (angular5) => NodeJs(Express) => IPFS node
When sending data form my web client i can see that i am sending an Uint8Array of 4000 items
Uint8Array[4000]
. When getting it back from IPFS and then sending it to my Web client i find out an Uint8Array of more than 4000 mostly double the number of items ( something likeUint8Array[8000]
) and it doesn't translate to an image when reading it afterwards ( using FileReader)This is my code :
This is the image reading function
With NativeInput the Jquery input item.
this is the storing function from my nodeJs Server :
the url argument is a nodeJs Buffer from the Uint8Array sent from my webClient.
this is the data getting function from IPFS
When logging the stringifyed data, i get a json object with type: Buffer and a data field which is an array of Uint8 but it turns out that is not the data i stored.
I searched elsewhere and i am not sure between a bug/problem with my IPFS or a problem of conversion between NodeJs Buffers and Web Buffers.
The text was updated successfully, but these errors were encountered: