A lightweight and very configurable jQuery plugin for file uploading using ajax(a sync); includes support for queues, progress tracking and drag and drop.
Since there's no way to cancel the upload (so far I've seen...), i.e. returning false in any of the hook methods which would prevent further execution, one can set the HTTP error code from the server and whatever helpful message is needed to notify the admin or the user their path isn't going to work.
Now, this is a bit hacky, but for my use the response from the server, be it a success or a failure, will return an HTTP response code and a JSON message. A bit more massaging can allow the user to see exactly what happened instead of the generic HTTP header message, i.e. "Bad Request" or "Forbidden" based on the HTTP code supplied.
By adding another hook object on the configuration of the widget, one get a better response from the server why something didn't work.
Later on (line ~255 of the src)
Since there's no way to cancel the upload (so far I've seen...), i.e. returning false in any of the hook methods which would prevent further execution, one can set the HTTP error code from the server and whatever helpful message is needed to notify the admin or the user their path isn't going to work.
Now, this is a bit hacky, but for my use the response from the server, be it a success or a failure, will return an HTTP response code and a JSON message. A bit more massaging can allow the user to see exactly what happened instead of the generic HTTP header message, i.e. "Bad Request" or "Forbidden" based on the HTTP code supplied.