I am transferring the image from the server ( Node.js ) to the browser , and then send it from the browser to moralis :
server node.js
var photo = fs.readFileSync("…/nfts/resulte/photos/"+aData[nd].replace(".json",".png"), {encoding: ‘base64’})
socket.emit(“res”,{photo : photo})
browser :
socket.on(“res”, d => {
const imageFile = new Moralis.File(“image name”, d.photo)
await imageFile.saveIPFS();
let imageHash = imageFile.hash();
…
})
I get this erorr : Uncaught (in promise) TypeError: Cannot create a Parse.File with that data.
ParseFile moralis.js:12787
setTYhis main.js:40
main.js:38
emit index.js:143
emitEvent socket.js:276
onevent socket.js:263
onpacket socket.js:228
emit index.js:143
ondecoded manager.js:200
emit index.js:143
add index.js:110
ondata manager.js:192
emit index.js:143
onPacket socket.js:323
emit index.js:143
onPacket transport.js:100
onData transport.js:92
onmessage websocket.js:76
addEventListeners websocket.js:76
doOpen websocket.js:61
open transport.js:44
probe socket.js:270
onOpen socket.js:290
onHandshake socket.js:344
onPacket socket.js:308
emit index.js:143
onPacket transport.js:100
callback polling.js:83
onData polling.js:86
emit index.js:143
onData polling-xhr.js:188
onLoad polling-xhr.js:229
onreadystatechange polling-xhr.js:147
initApp main.js:98
login main.js:86
main.js:143
moralis.js:12787:15