Here is the file stream, how to add to IPFS ???
blockChainB opened this issue · 1 comments
blockChainB commented
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 ???
});
alanshaw commented
ipfs.files.add([{
path: __dirname + "/images/abc.jpg"
content: response.data
}], (err, result) => {
if (err) throw err
console.log(result)
})
Hope that helps!