Please note that Axios works a bit differently on server-side.
I don’t remember how exactly it should be configured, but here is an working example with request module for server-side upload:
const uri = encodeURI('./Files/TestSumit (2).pdf');
const options = {
method: 'POST',
url: 'http://127.0.0.1:1337/upload',
headers: {
'Content-Type': 'multipart/form-data',
},
formData: {
files: fs.createReadStream(uri),
},
};
request(options, function (err, res, body) {
if (err) console.log(err);
console.log(body);
});