Hello,
I am trying to upload files to infura ipfs. I am using node js and this is my code:
var file = req.files['file'][0];
const options = {
host: 'ipfs.infura.io',
port: 5001,
path: '/api/v0/pin/add',
method: 'POST',
auth: projectId + ':' + projectSecret,
file: file,
};
let request = https.request(options, (resp) => {
let body = '';
resp.on('data', function (chunk) {
body += chunk;
});
resp.on('end', function () {
console.log(body);
});
});
request.end();
However i get the following error: “ipfs-path is required”. How can I fix this?