I'm forced to use the ipfs-car CLI library now web3.storage (and nft.storage) have started to make their process a bit more restricted. I avoid using their NodeJS libraries wherever possible since they change / break too often. https://web3.storage/docs/concepts/car/#ipfs-car
Previously you could shove any data you want to an IPFS endpoint and it would kindly return the IPFS CID, now you need to generate the CID and some other file-specific info prior to uploading.
Thankfully getting data is still straightforward and can be requested anonymously from any number of IPFS gateways.
Happy to share NodeJS snippets if you want a primer since it's a bit tedious to work through their docs.
# Step 4: Post the file if step 3 returns false. The endpoint (puturl in this case) will be provided by the previous step, and is ALWAYS an AWS endpoint 😀
I've left the JSDoc comment here since there's a few more parameters.
```
/**
* Function to upload a file using a PUT request.
* @param {Object} params - The parameters for the PUT request.
* @param {string} params.putUrl - The URL to send the PUT request to.
* @param {number} params.size - The size of the file in bytes.
* @param {string} params.checksumSha256 - The SHA-256 checksum of the file.
* @param {string} params.filename - The path to the file to be uploaded.
* @returns {Promise
*/
async function putFun({ putUrl, size, checksumSha256, filename }) {
Thanks, seems pretty comprehensive and to be honest I’ll probably opt for Blossom in future projects. I’m getting more and more engrossed in Nostr at the minute.