I am streaming an MHTML file to an aspx page:
Response.Clear()
Response.AddHeader("Content-Disposition", "inline; filename=MyFile.mht")
Response.AddHeader("Content-Length", MyByteArray.Length.ToString)
Response.ContentType = "multipart/related"
Response.BinaryWrite(MyByteArray)
Response.Flush()
When I load the aspx page on my computer with IE... I get "Invalid syntax
error"... when I load the same page... thru HTTP access from a co-worker's
computer... it loads fine... what am I doing wrong?
Not sure if it makes a difference... I had the address bar hidden so I didn't
notice at first... when my co-worker renders the stream the url stays the
same... for me I get mhtml: in front of the url... in addition to the
"invalid syntax" error.I figured I should post this in case other ppl were looking for some
answers... apparently my MHTML issue has something to do with a security
patch for IE... there is however a way to get around it...
You can attach a dummy query string to your aspx page that ends with a .mht.
For example, if the page that streams down mht content is MyPage.aspx, then
you want to use this URL:
http://Path-To-File/MyPage.aspx?ignored=whatever.mht
"MER78" wrote:
> I am streaming an MHTML file to an aspx page:
> Response.Clear()
> Response.AddHeader("Content-Disposition", "inline; filename=MyFile.mht")
> Response.AddHeader("Content-Length", MyByteArray.Length.ToString)
> Response.ContentType = "multipart/related"
> Response.BinaryWrite(MyByteArray)
> Response.Flush()
> When I load the aspx page on my computer with IE... I get "Invalid syntax
> error"... when I load the same page... thru HTTP access from a co-worker's
> computer... it loads fine... what am I doing wrong?
> Not sure if it makes a difference... I had the address bar hidden so I didn't
> notice at first... when my co-worker renders the stream the url stays the
> same... for me I get mhtml: in front of the url... in addition to the
> "invalid syntax" error.
No comments:
Post a Comment