image
image copied to clipboard
Prevent user from selecting the image in certain situations
How can we prevent the user from selecting an image in certain situations?
My problem is that I succeed on preventing the upload of the image to the server but the UI is still loaded with the image selected. I don't know how to clear or avoid showing it.
The plugin says we should return a Promise when using the function uploadByFile. What have I tried:
uploadByFile(file)
{
alert('Error, you cannot proceed');
// Does not work
return Promise.reject(new Error(''));
// Does not work
return new Promise((resolve, reject) => {});
// Does not work
return false;
},