How to upload a file and notify a client