var form = new FormData();
form.append("file", fs.createReadStream(file.path));
form.append('site', site);
form.append('environment', environment);
var mothod = 'PUT'
var url = "http://localhost:8000/" + method;
xhr.open(method, url);
xhr.send(form);
}
Error
TypeError: First argument must be a string or Buffer
at ClientRequest.OutgoingMessage.write (_http_outgoing.js:457:11)
at exports.XMLHttpRequest.send (/Users/Desktop/proyect/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:467:17)
package.json "xmlhttprequest": "1.8.0", "form-data": "2.3.1"
Error TypeError: First argument must be a string or Buffer at ClientRequest.OutgoingMessage.write (_http_outgoing.js:457:11) at exports.XMLHttpRequest.send (/Users/Desktop/proyect/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:467:17)