Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 33929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T13:59:55+00:00 2026-05-10T13:59:55+00:00

I am trying to upload a file or stream of data to our web

  • 0

I am trying to upload a file or stream of data to our web server and I cant find a decent way of doing this. I have tried both WebClient and WebRequest both have their problems.

WebClient
Nice and easy but you do not get any notification that the asynchronous upload has completed, and the UploadProgressChanged event doesnt get called back with anything useful. The alternative is to convert your binary data to a string and use UploadStringASync because then at least you get a UploadStringCompleted, problem is you need a lot of ram for big files as its encoding all the data and uploading it in one go.

HttpWebRequest
Bit more complicated but still does what is needed, problem I am getting is that even though it is called on a background thread (supposedly), it still seems to be blocking my UI and the whole browser until the upload has completed which doesnt seem quite right.

Normal .net does have some appropriate WebClient methods for OnUploadDataCompleted and progress but these arent available in Silverlight .net … big omission I think!

Does anyone have any solutions, I need to upload multiple binary files preferrably with a progress but I need to perform some actions when the files have completed their upload.

Look forward to some help with this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T13:59:55+00:00Added an answer on May 10, 2026 at 1:59 pm

    The way i get around it is through INotifyPropertyChanged and event notification.

    The essentials:

     public void DoIt(){ this.IsUploading = True;              WebRequest postRequest = WebRequest.Create(new Uri(ServiceURL));          postRequest.BeginGetRequestStream(new AsyncCallback(RequestOpened), postRequest);     }  private void RequestOpened(IAsyncResult result){       WebRequest req = result.AsyncState as WebRequest;    req.BeginGetResponse(new AsyncCallback(GetResponse), req);     }    private void GetResponse(IAsyncResult result)         {             WebRequest req = result.AsyncState as WebRequest;               string  serverresult = string.Empty;               WebResponse postResponse = req.EndGetResponse(result);                StreamReader responseReader = new StreamReader(postResponse.GetResponseStream());  this.IsUploading= False; }   private Bool_IsUploading;         public Bool IsUploading         {             get { return _IsUploading; }           private  set             {                  _IsUploading = value;                  OnPropertyChanged('IsUploading');             }         } 

    Right now silverlight is a PiTA because of the double and triple Async calls.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to upload file to an sharepoint online server using webclient. Up
I'm trying to upload a file .txt in my web space, but then the
I'm trying to upload a file to an FTP server using code based on
I am trying to upload a file from a php form. I have verified
I have to upload a file ,while iam trying to run showing the message
Trying to use fileReader.readAsBinaryString to upload a PNG file to the server via AJAX,
I am trying to upload a file to an FTP-server using a URLConnection. There
I am trying to upload a file to a ftp server using libcurl but
I am trying to upload image file from my one server to another remote
I am trying to upload file on HTTP server using POST but when I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.