Note that there are some explanatory texts on larger screens.

plurals
  1. POUpload binary data with Silverlight 2b2
    primarykey
    data
    text
    <p>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 <code>WebClient</code> and <code>WebRequest</code> both have their problems. </p> <p><strong>WebClient</strong><br> Nice and easy but you do not get any notification that the asynchronous upload has completed, and the <code>UploadProgressChanged</code> event doesnt get called back with anything useful. The alternative is to convert your binary data to a string and use <code>UploadStringASync</code> because then at least you get a <code>UploadStringCompleted</code>, problem is you need a lot of ram for big files as its encoding all the data and uploading it in one go.</p> <p><strong>HttpWebRequest</strong><br> 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.</p> <p>Normal .net does have some appropriate <code>WebClient</code> methods for <a href="http://msdn.microsoft.com/en-us/library/system.net.webclient.onuploaddatacompleted.aspx" rel="nofollow noreferrer">OnUploadDataCompleted</a> and progress but these arent available in Silverlight .net ... big omission I think!</p> <p>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.</p> <p>Look forward to some help with this.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload