Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent user from selecting the image in certain situations #178

Open
PINHOf opened this issue Mar 4, 2022 · 0 comments
Open

Prevent user from selecting the image in certain situations #178

PINHOf opened this issue Mar 4, 2022 · 0 comments

Comments

@PINHOf
Copy link

PINHOf commented Mar 4, 2022

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.

See JSFiddle example

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;
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant