I tried to upload an object into IPFS but there was an error
Input not supported. Expected Buffer|ReadableStream|PullStream|File|Array<Object> got object
this is my javascript code :
let data = {
name: bot,
description: "",
image: "https://ipfs.infura.io/ipfs/myimagehash",
};
const client = ipfsClient({
host: "ipfs.infura.io",
port: 5001,
protocol: "https",
});
try {
const added = await client.add(data);
const url = `https://ipfs.infura.io/ipfs/${added[0].path}`;
return url;
} catch (error) {
console.log("Error uploading file: ", error);
}