V K
V K

Reputation: 1719

Does WebClient UploadProgressChanged event doesn't work for "PUT" method

I am using a "PUT" rest webservice to upload a file to One Drive.I have used both UploadDataAsync and UploadStringAsync methods of webclient. But in both cases the UploadProgressChanged event is only fired after the whole file is uploaded.Please suggest.I need to show progress of upload operation in progress bar.

 wc.UploadProgressChanged += new UploadProgressChangedEventHandler((sender, e) => webclient_UploadProgressChanged(sender, e, updateProgress));


                            wc.UploadStringCompleted += new UploadStringCompletedEventHandler(wc_UploadStringCompleted);
                            wc.UploadStringAsync(uriForUploading.Uri, "PUT", result);

Upvotes: 0

Views: 489

Answers (1)

V K
V K

Reputation: 1719

I tried using the uploadFileAsync funtion instead of uploadDataAsync, and it worked.Seems there is issue with WebClient class.

Upvotes: 0

Related Questions