Closed Flynsarmy closed 9 years ago
Thanks for the help! I didn't have much time on my hands to merge PR's, but now I have a large-ish amount of time to fix stuff. I'm actually rewriting the library in ES6 right now, and I just incorporated your functionality on that branch (es6
), with an adjustment: instead of throwing and catching errors, you have to return false
in the callback.
I originally thought of returning false too, however its nice to be able yo send custom error messages, which throw let's you do. Otherwise you know an error occurred but have no idea what went wrong.
Well, you can always show an alert()
before returning false. And you can also show your custom error message, so you have more options this way.
This PR allows you to do stuff like:
This will make an error appear on upload in the same way one would appear if you didn't meet the file extension requirements.