I followed the example in the callbacks section of your docs regarding throwing an error if a file is larger than a certain size, but this error isn't visible. Is this a bug in the filestack code? If I call a default alert() before throwing the error I can still indicate to the user that there was a problem, but it would be nice if this was displayed in the picker itself.
const client = filestack.init(apiKey);
const maxSizeMegabytes = 10;
const options = {
fromSources: ["local_file_system"],
accept: [".pdf"],
onFileSelected: file => {
// If you throw any error in this function it will reject the file selection.
// The error message will be displayed to the user as an alert.
if ( file.size > 1000 * 1000 * maxSizeMegabytes ) {
throw new Error(`File too big, select something smaller than ${maxSizeMegabytes}MB`);
}
}
};
https://www.filestack.com/docs/concepts/pickers/web/#callbacks
I followed the example in the callbacks section of your docs regarding throwing an error if a file is larger than a certain size, but this error isn't visible. Is this a bug in the filestack code? If I call a default
alert()
before throwing the error I can still indicate to the user that there was a problem, but it would be nice if this was displayed in the picker itself.