views:

364

answers:

1

From a winforms application, I need to upload & download files to an asp.net web server using http/https.

  • only need to send/receive one file at a time
  • cannot use ftp, must use http/https
  • need progress bar
  • upload & download must be username/password authenticated

Is there an easy way to do this?

+4  A: 

The WebClient class should be able to do everything you need to do. Use either UploadFileAsync Or UploadDataAsync for the upload (and their counterparts for the download), normal HTTP authentication for the username and password (see the Credentials property) and the UploadProgressChanged event for tracking progress for your progress bar.

Matti Virkkunen
What would be preferable to receive and send the data on the server end: webservice, wcf, or asp.net form?
mikeh
Out of those, ASP.NET would probably be the easiest to use with plain WebClient.
Matti Virkkunen