Closed ptheofan closed 1 year ago
I had the same issue. Another problem is that the oauth_token should be sent as a url parameter.
A workaround would be to post the file using fetch (or any other way you prefer) and include the token.
const formData = new FormData();
formData.append('file', fs.createReadStream(file));
const response = await fetch(`https://upload.put.io/v2/files/upload?oauth_token=${this.api.token}`, {
method: 'POST',
body: formData,
});
and import
import FormData from 'form-data';
import fs from 'fs';
import fetch from 'node-fetch';
should be fixed in v8.35.1
, sorry for the late response...
https://github.com/putdotio/putio.js/blob/7a02cec49669759bf525c006f3b333d8770f4c8b/src/resources/Files/Files.ts#L327
as per axios it looks like the post request does not hit
upload.put.io
. Instead, it hitsapi.put.io