twilson63/ngUpload — pull request #72 by mguymon (2013-10-03 16:17:45+00:00)
Title: Add beforeSubmit callback

I added an option for defining a before submit callback. The option val is a function defined in the scope. This is called before the submit and the iframe is generated. If the callback returns false, the submit is canceled.

I have a use case that roughly translates to: User's session times out -> They upload an image -> They get a blank screen. This is due to the iframe handling the upload, but failing because the session timeout. The BeforeSubmit callback lets me verify they have access before starting up the upload.