views:

42

answers:

1

I am writing a desktop app in C# for upload large sized files on a webserver using HTTP PUT. I have tried libcurl .net but it seems the bindings seem pretty difficult to use.

Is there a better and easier way?

PS: My server is nginx. I believe HTTP PUT is the best way but if there is a better alternative available on nginx, I can use that as well.

+3  A: 

Have you tried the built-in WebClient, doesn't get much simpler:

var wc = new WebClient();
wc.UploadData("http://www.example.com/upload-image", "PUT", imageData);

(WebClient.UploadFile is also available, which might be even better, depending on where your image data is located)

Dean Harding
Is it also possible to get callbacks to monitor the progress of the upload?
sharjeel
Oh just noticed it has the callbacks for monitoring progress :-) Thanks a lot!
sharjeel