Hi,
this is my first time using IPFS as storage solution
In docs i saw that every upload returns unique path but in my case returned Path is same for different uploads
I’m using React to upload files here is code snippests
// function to upload file
const postMediaUploader = async () => {
setIsVideoUploading(true)
// post video is state value where a file to upload is stored
const result = await uploadIpfs(postVideo)
// this is the state where i store the uploaded file path
setMediaURI(result.path)
console.log(result.path)
return result
}
Client config and the function to use to upload files
const client = create ({
host : "ipfs.infura.io",
port : 5001,
protocol: 'https',
headers: {
authorization: auth,
},
});
// the function I'm using to upload data
export const uploadIpfs = async (data) => {
try {
const result = await client.add(JSON.stringify(data));
console.log("ipfs results", result)
return result;
} catch (error) {
alert(error)
}
}
In the console.log Here is the results
this is the Three different files uploads but it seems like all returned data is same
Is how it should work ? or somthing I’m missing?