Added callback and onWrite function

I added the callback for the emit function, so you can get back information from the server on finishing the file write, such as a new file name for example.
Also added onWrite function that you can pass in options to createStream. It is useful for tracking progress of upload.