fire event on upload, added maxfilesize and minfilesize with error callbacks, check if error is function before calling it