0

I've uploaded some files using js-ipfs without converting it into Buffer or Readable stream, and it works just fine.

since IPFS converts the file into blocks anyway, why use buffer/stream!

what are the pros and cons of this?

1 Answer 1

0

That depends on the service you use to upload the files. They may have different requirements, but the end result is the same.

Using buffers/streams is mostly useful if you're dealing with lots of data and/or in an environment where memory is limited. Streaming data means you don't transfer all at once, but send smaller pieces all the time. That wait the recipient doesn't need to accept a big file at once, which may drain resources.

2
  • am using js-ipfs
    – Xylan
    Jan 6, 2022 at 14:37
  • thanks for sharing your inputs here. Sorry for reaching you out of the blue. I was wondering if you could assist me with this. I am kind of not finding any information anywhere else. ethereum.stackexchange.com/questions/118130/… Thanks a ton in advance. Jan 6, 2022 at 22:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.