[mapguide-users] Forcing MgByteReader download prompt in IE7 (asp.net)

Jackie Ng jackie.ng at aecsystems.com.au
Mon Oct 22 02:04:43 EDT 2007


I'm trying to write out the contents of an MgByteReader (which is from a dwf
plot) so that the user is prompted to download the MgByteReader content as a
file. I can get this to work perfectly in Firefox/IE6, but for some reason
in IE7 doesn't prompt me to download, and I get nothing in the browser
window.

Here's the code in question, byteReader is the MgByteReader containing a dwf
plot. 

----------------------------------------------------
using (MemoryStream stream = new MemoryStream())
{
    byte[] buffer = new byte[1024];
    int bytes = byteReader.Read(buffer, 1024);

    while (bytes > 0)
    {
        stream.Write(buffer, 0, bytes);
        bytes = byteReader.Read(buffer, 1024);
    }

    Response.ContentType = byteReader.GetMimeType();
    byte[] content = stream.ToArray();
    
    Response.AppendHeader("content-disposition", "attachement;
filename=\"eplot.dwf\"");
    Response.OutputStream.Write(content, 0, content.Length);
}
-------------------------------------------------------

Does anyone know how I can get IE7 to cooperate with me? >:-(

- Jackie
-- 
View this message in context: http://www.nabble.com/Forcing-MgByteReader-download-prompt-in-IE7-%28asp.net%29-tf4668855s16610.html#a13337260
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list