Upload large files in blocks
huyanyawei opened this issue · 2 comments
How to use js-ipfs-http-client in web browser to upload fragments? Can you share the code?
Maybe I don't understrand the fragment but I think that is the 256 KB piece of a ipfs object.
You could use mutable file system there is a protocol labs course that explains how to work with.
I loaded, not an image but an .mp3 file that is a good sized (about 11MB) file to check what is going back there. And the result is that you don't need to worrie about how to split the file in 256 KB little pieces, the API do the hard work.
Maybe you are trying something like ipfs.object.
Try this
- add a file to ipfs (from command line or using ipfs-http-client).
ipfs add cumbion.mp3
then you got a Qm... hash.
- get the file
ipfs get QmaFk97RhYVv9LcPw1MY7WApxBjw1oMnfTr5bH4B4wUcXd
then play it to check that is the file you have been added before (and if is a cumbión, dance!)
- try get the same address as object.
ipfs object get QmaFk97RhYVv9LcPw1MY7WApxBjw1oMnfTr5bH4B4wUcXd
wait... is this a file or an object?
- try dag.
ipfs dag get QmaFk97RhYVv9LcPw1MY7WApxBjw1oMnfTr5bH4B4wUcXd
is this my cumbión?
Hope this helps.
Thanks for your reply ! I have solved this problem very well . And your ideas is also right.