HttpWebRequest.AllowWriteStreamBuffering in Silverlight for large file upload
<p>We are developing an application using Silverlight 4.0 using C#. Our silverlight application is calling Java Web Services for data exchange.</p>

<p>We want to implement Large file upload (more than 500 MB) in our application and when we tried to do it, it is giving Out of Memory Exception. So after investigation, we decided to use multi-part/form data option to upload large files and on server side there will be a servlet which will handle this multi-part request. </p>

<p>The solution we implemented is refered from following link : <a href="http://www.shaneng.net/?n=Main.Multi-PartFormPost" rel="nofollow">http://www.shaneng.net/?n=Main.Multi-PartFormPost</a>. The only change we made in this code is we are using ClientHttp stack with HttpWebRequest 
i.e. instead of  </p>

<pre><code>HttpWebRequest request = (HttpWebRequest)WebRequest.Create(new Uri("http://localhost/test.php"));
</code></pre>

<p>we are using </p>

<pre><code>HttpWebRequest request = (HttpWebRequest)WebRequestCreator.ClientHttp.Create(new Uri("our servlet Path"));
</code></pre>

<p>and we are making request.AllowWriteStreamBuffering = false which is missing in that post.</p>

<p>With this code our large files get uploaded successfully. But immediately after uploading large file, when we try to call our web service method with any button click, it is giving error "The remote server returned an error: Not Found". When we check our server log, we are not receiving a call on web service. </p>

<p>When we try to test it using Fiddler, everything works fine without any error. Also this thing works fine with Mozilla Firefox. We are having this problem only with IE (any version of IE)</p>

<p>But when we change request.AllowWriteStreamBuffering = false to request.AllowWriteStreamBuffering = true in silverlight, everything works fine. But it do not allow to upload large files. </p>

<p>Can anybody help me to resolve this issue ? 
When <code>HttpWebRequest.AllowWriteStreamBuffering is set to false</code>, what it exactly do ?</p>

<p>Regards
Vipul</p>
