Hi,
I am having an issue with uploading image for document verification in sandbox environment. I am getting “Invalid file type” error. Here are the logs:
Everything works well through the Postman. When I use curl command and execute it from terminal it works, same for NodeJs using ‘request’ library, but when I try same thing with ‘axios’ or ‘follow-redirects’ I get “Ivalid file type” again.
Here is the code which does not work and I am using your documentation:
const stream = new Duplex();
stream.push(file.data);
stream.push(null);
// Create a form data object and append the file to it
const body = new FormData();
body.append("file", stream, {
filename: file.filename,
contentType: file.type,
knownLength: file.data.length,
});
body.append("documentType", type);
const uploadDocumentResponse = await dwollaClient.post(documentUrl, body);
I am using “dwolla-v2”: “^3.4.0” and “form-data”: “^4.0.0”.
What could be the issue here? Thanks
