Note that there are some explanatory texts on larger screens.

plurals
  1. POASP.Net: asynchronous image upload displayed using handler
    text
    copied!<p>I have a really specific question for which I don't think I will have an answer but... let's try! I have an aspx web page that works perfectly with Firefox and Chrome but not on IE9 (don't feed the troll ^^).</p> <p>My objective is to allow an asynchronous image upload using ASP AjaxControlToolkit (see <a href="http://www.asp.net/ajaxlibrary/AjaxControlToolkitSampleSite/asyncfileupload/asyncfileupload.aspx" rel="nofollow">http://www.asp.net/ajaxlibrary/AjaxControlToolkitSampleSite/asyncfileupload/asyncfileupload.aspx</a> for a demo). When the image asynchronous upload is finished, the UploadedComplete function is called and I put the image in a session variable :</p> <pre><code>if (fileSizeOk &amp;&amp; fileTypeOk) Session["image"] = this.AsyncFileUploadLogo.FileBytes; </code></pre> <p>In parallel I have a handler responsible for returning an image from the session variable :</p> <pre><code>byte[] buffer = (byte[])context.Session["image"]; context.Response.OutputStream.Write(buffer, 0, buffer.Length); context.Response.OutputStream.Flush(); </code></pre> <p>Then, in my aspx page, I have an asp:Image field in a UpdatePanel that asks to the handler to get the image every five second :</p> <pre><code>&lt;asp:UpdatePanel ID="UpdatePanelLogo" runat="server"&gt; &lt;ContentTemplate&gt; &lt;asp:Image ID="ImageFileUploaded" runat="server" ImageUrl="AsyncImageHandler.ashx" /&gt; &lt;asp:Timer ID="TimerFileUploaded" Interval="5000" runat="server" /&gt; &lt;/ContentTemplate&gt; &lt;/asp:UpdatePanel&gt; </code></pre> <p>When the user validates the form, I just have to get the variable from the session and I save the image in database with the other values.</p> <p>Here is my problem: with Firefox and Chrome, the timer provokes the reloading of the image but with IE (even IE9) the image is only displayed after hitting F5. When I put a breakpoint in the handler I can see that it's never called with IE (maybe a caching mechanism?).</p> <p>Do you have an idea of ​​how to solve this problem?</p> <p>Thanks for your answers!</p>
 

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