ipfs-inactive/interface-js-ipfs-core

Here is the file stream, how to add to IPFS ???

blockChainB opened this issue · 1 comments

axios({
method:'POST',
url:url,
data: {
scene:address,
page: page,

    },
    responseType:'stream'
})
    .then(function(response) {



   response.data.pipe(fs.createWriteStream(__dirname + "/images/abc.jpg"))

============================
now how to pipe to ipfs and add to IPFS and get the image hash ???

});
ipfs.files.add([{
  path: __dirname + "/images/abc.jpg"
  content: response.data
}], (err, result) => {
  if (err) throw err
  console.log(result)
})

Hope that helps!