Implement error callback

Added support for the upload error callback. The flash file also listens for progress and http status events as well.