I am using FileStack Javascript SDK
to upload files to My S3 Bucket
. In FileStack developer's portal, I added my Amazon Account's dtails i.e Access ID, Access Key, Bucket Name & Bucket Path & then I used following script to upload files:
const client = filestack.init('MY-FILESTACK-API-KEY');
let options = {
"displayMode": "overlay",
"container": ".picker-content",
"maxFiles": 4,
"accept": [
"image/jpeg",
],
"storeTo": {
"container": "MY-BUCKET-NAME",
"path": "https://s3-MY-BUCKET-REGION.amazonaws.com/MY-BUCKET-NAME",
"region": "MY-BUCKET-REGION",
"disableKey": true,
},
"fromSources": ["local_file_system"],
"uploadInBackground": false,
exposeOriginalFile: true,
onFileSelected: onFileSelect,
onUploadDone: function(){
console.log('upload done');
},
}
$("#filestack-picker-btn").click(function(){
picker = client.picker(options);
picker.open();
});
Now, Code runs successfully & I can see uploaded files in FileStack CONTENT BROWSER area but when I go to my S3 bucket. I can't see any file uploaded there.
I want to use FileStack only to upload files in my S3 bucket & not in FileStack's Internal Storage.
I think you are missing location: s3
in storeTo
dictionary (https://filestack.github.io/filestack-js/interfaces/pickerstoreoptions.html#location).