Open drewbaker opened 4 years ago
Hi @drewbaker , please check the docs: https://www.filestack.com/docs/concepts/delivery/
e.g.: https://cdn.filestackcontent.com/
Thanks! I have the handle, but how do I get the signature? That is the bit that is not clear in the docs.
My URL needs to be something like this (not a real link, I made it up): https://cdn.filestackcontent.com/security=p:hjskdgkahsgdhkKHGKGwkjhkjhKUKHKJDLHDLJD,s:DJDHLJHDLSJKHDLKJSHDLKJSgkughkukhKJGJGKgkjgkug
Hi, go to your https://dev.filestack.com/ account Security section, you can generate security policy and signature.
For anyone else stumbling upon this, I found the solution. Assuming you've set your security variables when initialising the client, you can simply call transform
to get the signed URL after the upload is complete. For example:
const fileStack = filestack.init('{api_key}', {
security: {
policy: '...',
signature: '...'
}
});
fileStack
.picker({
//...
onFileUploadFinished: file => {
const url = fileStack.transform(file.handle);
console.log(url); // The URL is now signed
}
})
.open();
View right at the bottom of https://www.filestack.com/docs/security/policies/ for how to do it.
Format is currently: https://cdn.filestackcontent.com/security=policy:{policy},signature:{signature}/{HANDLE}
Security is set up like this: https://www.filestack.com/docs/tutorials/security-best-practices/
I have the
fileId
, and I have my API key (from a request to the server), how do I generate a download URL client side? I'm trying to show links to the files you've selected to upload.Is there a better place to be asking these sorts of basic usage questions?