Hi everyone, I am uploading images directly from client side to S3 (@uppy/aws-s3) using pre-signed urls, the images are being uploaded, but “data.uploadURL” in the “upload-success” event is undefined.
let flyerUploader = new Uppy({
id: 'flyer',
debug: true,
autoProceed: true,
restrictions: {
maxFileSize: 2*1024*1024,
maxNumberOfFiles: 1,
minNumberOfFiles: 1,
allowedFileTypes: ['image/*']
}
})
.use(Dashboard, {
target: '#flyer',
inline: true,
height: 350,
})
.use(AwsS3, {
shouldUseMultipart: (file) => false,
getUploadParameters (file) {
return fetch(Helpers.route('admin/storage/presigned_url'), {
method: 'post',
headers: {
accept: 'application/json',
'content-type': 'application/json',
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
body: JSON.stringify({
filename: file.name,
contentType: file.type
})
}).then((response) => {
return response.json()
}).then((data) => {
return {
method: data.method,
url: data.url,
fields: data.fields,
headers: data.headers
}
})
}
});
flyerUploader.on('upload-success', (file, data) => {
console.log(data); //data.uploadURL undefined
});
Here is an image of data variable
What am i missing here?
Thanks!