filestack / filestack-js

Official Javascript SDK for the Filestack API and content ingestion system.
https://www.filestack.com
MIT License
206 stars 76 forks source link

client.upload is returning key as undefined #487

Open sanjiv221 opened 1 year ago

sanjiv221 commented 1 year ago
    const client =  filestack.init("Your API Key");
    await client.upload("/tmp/"+filename, {}, { filename: filename }, {}).then(data => {console.log(data)})

console.log output: File { _file: { name: 'Test.pdf', size: 12668, type: 'application/pdf', slice: [Function: slice] }, _sanitizeOptions: undefined, status: 'Stored', handle: 'some value', url: 'https://cdn.filestackcontent.com/{some value}', container: undefined, key: undefined, <---- is undefined uploadTags: undefined, workflows: undefined }

knquintana commented 1 year ago

I ran into a similar issue with the picker and found that I had not configured the store options correctly. I added the following store options and the key was populated

 storeTo: {
   location: 's3',
}