Hello, I'm looking for a way to pause or resume an upload process via C#'s WebClient.

pseudocode:

WebClient Client = new WebClient();
Client.UploadFileAsync(new Uri("http://mysite.com/receiver.php"), "POST", "C:\MyFile.jpg");

Maybe something like..

Client.Pause();

any idea?

To truly pause an upload you should kill the connection. Another method would be to manually control sending the chunks of data and start sending a minimal amount of data so the transfer is not truly pause but is sending enough data to keep the connection alive. This isn't a straightforward task unless you use resumed uploading:

http://www.webdavsystem.com/client/programming/upload/resumable_upload

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.