Hi Team,
I have created a 8base backend where i am having file as one of the field for a table.Here i am trying to upload file to filestack from 8base frontend and trying to get the handle id as a response from filestack and with that i am trying to store it in backend table by mutation.I have used filestack at the frontend custom code on file input onchange,
const options = {
storeTo: {
location: “S3”,
path: “production/cleij1gxy00p908jr2tws13oh/clftv5fn7009208mm66qn4pam/”,
},
security: {
signature: “95fed006f8fcb60f62832befdc57598c536bbc820a10c7844dbdb00a2947375c”,
policy: “eyJjYWxsIjpbInJlYWQiLCJwaWNrIiwic3RvcmUiLCJjb252ZXJ0Il0sImV4cGlyeSI6MTY4MDE5MTQyMiwicGF0aCI6InByb2R1Y3Rpb24vY2xlaWoxZ3h5MDBwOTA4anIydHdzMTNvaC9jbGZ0djVmbjcwMDkyMDhtbTY2cW40cGFtLyJ9”,
}
}
const client = filestack.init(“Abj6n4LZFRoS9eTRfPmWTz”,options)
client.upload(event.target.files[0]).then((res) => {
console.log(res)
imageSource.setValue(res.url)
})
after uploading this i am getting url as a response, but if am trying to copy that handle id from response and store it in backend eg:
mutation{
tableCreate(data:{
file:{
create:{
fileId:“handle id from frontend”
}
}
}){
}
}
this mutation throw me error saying that “Invalid file path”
I know that i have making mistakes in the upload options from frontend.I have configured the signature and policy and i dont know how to speciy the path which is given above.