Amazon S3 TransferUtility.Upload hangs in C#

后端 未结 2 705
故里飘歌
故里飘歌 2020-12-31 11:34

So I\'m writing a migration application, to take some data from our local storage and upload it to Amazon. Everything is working fine, except once I get into files that are

2条回答
  •  攒了一身酷
    2020-12-31 12:01

    Try using BeginUpload method instead of Upload.

            transferUtility.BeginUpload(request, new AsyncCallback(uploadComplete), null );
        }
        private void uploadComplete(IAsyncResult result)
        {
            var x = result;
        }
    

    Setup your transfer utility and UploadProgressEvent as you did before. Use the Invoke method within the progress handler as you did. If you use BeginUpdate() instead of Update() it will prevent the app from hanging on the first update to your form. I couldn't find this solution anywhere so I hope it works for you.

提交回复
热议问题