Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
reader.onloadend = function () {
const buffer = IpfsHttpClient.Buffer.from(reader.result);
self._ipfsConnection.add(buffer, function (err, result) {
if (err) {
return reject(err);
}
resolve(result[0].path);
});
};
reader.readAsArrayBuffer(file);