public static void AsyncAppendObject(string bucketName) { const string key = "AsyncAppendObject"; long position = 0; try { var metadata = client.GetObjectMetadata(bucketName, key); position = metadata.ContentLength; } catch (Exception) { } try { using (var fs = File.Open(fileToUpload, FileMode.Open)) { var request = new AppendObjectRequest(bucketName, key) { ObjectMetadata = new ObjectMetadata(), Content = fs, Position = position }; const string notice = "Append object succeeded"; client.BeginAppendObject(request, AppendObjectCallback, notice.Clone()); _event.WaitOne(); } } catch (OssException ex) { Console.WriteLine("Failed with error code: {0}; Error info: {1}. \nRequestID:{2}\tHostID:{3}", ex.ErrorCode, ex.Message, ex.RequestId, ex.HostId); } catch (Exception ex) { Console.WriteLine("Failed with error info: {0}", ex.Message); } }