KNOWLEDGE BASE

Uploading File Asynchronously

On This Page

Uploading File Asynchronously

You can upload a file asynchronously using the HTTP class.

Example

HTTP http = new HTTP();

http.Hostname = “HostnameAddress”;

http.FileUploadCompleted += new HTTP.UploadFileCompletedDelegate(http_FileUploadCompleted);

http.FileUploadProgressChanged += new HTTP.UploadFileProgressChangedDelegate(http_FileUploadProgressChanged);
http.UploadFileAsync(“C:\FileToUpload.txt”);
 
private void http_FileUploadProgressChanged(object sender, System.Net.UploadProgressChangedEventArgs e)
{
    MessageBox.Show(e.BytesReceived.ToString());
}

private void http_FileUploadCompleted(object sender, System.Net.UploadFileCompletedEventArgs e)
{
    MessageBox.Show(“File Uploaded Completed”);
}

Article Details

Need More Help?

Can't find the answer you are looking for? Our support team can help.