Closed alexbakers closed 2 years ago
Now I solve it like this.
const storage = new web3.Web3Storage({ token: process.env.STORAGE });
const files = await web3.getFilesFromPath(path.join(process.cwd(), "dir"));
const cid = await storage.put(
files.map((f) => {
return { ...f, name: f.name.replace("/dir", "") };
})
);
You can set the wrapWithDirectory
option for put
to false
Hello, friends.
I upload
/dir
to IPFS, and have URLipfs://bafy.../dir/index.html
Is it possible not to upload a folder
/dir
-ipfs://bafy.../index.html
?