Hello, good morning!
I am attempting to successfully build a workflow and am running into the error in the title. I am not super familiar with JS and may be missing something. Can I get some assistance here please I am trying to upload a csv to an Amazon S3 bucket via an api call by getting the pre-signed URL then uploading it via another api call written in JS
code and workflow below:
const array = [Object.keys(getOrgs.data[0])].concat(getOrgs.data)
const arraystring = array.map(it => {
return Object.values(it).toString()
}).join('\n');
const form = new FormData();
form.append('AWSAccessKeyId', getPreSignedURL.data.form_fields.AWSAccessKeyId);
form.append('key', getPreSignedURL.data.form_fields.key);
form.append('policy', getPreSignedURL.data.form_fields.policy);
form.append('signature', getPreSignedURL.data.form_fields.signature);
form.append('file', arraystring);
const options = {method: 'POST', headers: {accept: 'application/json'}};
options.body = form;
fetch(getPreSignedURL.data.url, options)
.then(response => console.log(response))
.catch(err => console.log(err));