Note that there are some explanatory texts on larger screens.

plurals
  1. POWebClient doesn't connect to IHttpHandler
    primarykey
    data
    text
    <p>I made my program according to example <a href="http://www.c-sharpcorner.com/UploadFile/nipuntomar/FileUploadsilverlight03182009030537AM/FileUploadsilverlight.aspx" rel="nofollow noreferrer">1</a> that was made for .NET framework 2, but I converted it to .NET framework 3.5. How should I modify this code to make it working? How can I debug server side? Server side seems to work when I manually insert parameters to url, so problem must be in client side code.</p> <pre><code>private void UploadFile(string fileName, System.IO.Stream data) { UriBuilder ub = new UriBuilder("http://localhost:59491/receiver.ashx"); ub.Query = string.Format("filename={0}", fileName); WebClient c = new WebClient(); c.OpenWriteCompleted += (sender, e) =&gt; { PushData(data, e.Result); e.Result.Close(); data.Close(); }; c.OpenWriteAsync(ub.Uri); } private void PushData(System.IO.Stream input, System.IO.Stream output) { byte[] buffer = new byte[4096]; int bytesRead; while ((bytesRead = input.Read(buffer, 0, buffer.Length)) != 0) { output.Write(buffer, 0, bytesRead); } } </code></pre> <p><a href="http://www.c-sharpcorner.com/UploadFile/nipuntomar/FileUploadsilverlight03182009030537AM/FileUploadsilverlight.aspx" rel="nofollow noreferrer">1</a> <a href="http://www.c-sharpcorner.com/UploadFile/nipuntomar/FileUploadsilverlight03182009030537AM/FileUploadsilverlight.aspx" rel="nofollow noreferrer">http://www.c-sharpcorner.com/UploadFile/nipuntomar/FileUploadsilverlight03182009030537AM/FileUploadsilverlight.aspx</a></p>
    singulars
    1. This table or related slice is empty.
    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