Closed bigBagBoogy closed 1 year ago
Hello @bigBagBoogy Could you post your code?
Hello rommel-pinata, Thank you for your reply. Here is my code:
const pinataSDK = require("@pinata/sdk")
const pinata = new pinataSDK(
"235*****cfd",
"793***db4"
)
const fs = require("fs")
const readableStreamForFile = fs.createReadStream("./faceTreeWhite.png")
const options = {
pinataMetadata: {
name: MyCustomName,
keyvalues: {
customKey: "customValue",
customKey2: "customValue2",
},
},
pinataOptions: {
cidVersion: 0,
},
}
pinata
.pinFileToIPFS(readableStreamForFile, options)
.then((result) => {
//handle results here
console.log(result)
})
.catch((err) => {
//handle error here
console.log(err)
})
and this is the error message:
yarn run v1.22.19
warning package.json: No license field
$ ****/node_modules/.bin/hardhat run utils/uploadToPinata3.js
/****/utils/uploadToPinata3.js:11
name: MyCustomName,
^
ReferenceError: MyCustomName is not defined
at Object.<anonymous> (****/utils/uploadToPinata3.js:11:15)```
greetings, Maarten
nevermind I'll use thirdweb.
I copied the example file in your docs for uploading a file, I change to the correct image in my files, However I now get:
ReferenceError: MyCustomName is not defined
I do not have the knowledge as to what goes here. Anything I put in that place comes back as undefined.
Tnx in advance for your reply!