First, you need to check up the result returned by
it might be cancelled. Also, you do the asynchronous operation. The call is not blocking the calling thread by the time the file is actually uploaded. Instead, the upload just starts and will be finished at some later time. You can check up if the file is actually uploaded later.
Also, to synchronize the asynchronous operation, you should use the returned result from
To understand it and the usage of
with asynchronous operations, you may need to learn working with Tasks in general.
See also: http://msdn.microsoft.com/en-us/library/dd321424%28v=vs.110%29.aspx