From: Trapulo on
I've an application that worked well on IIS6. I moved it to IIS7, and
response.contenttype is now ignored.

my code ends with:

Response.ContentType = "application/vnd.ms-excel"

Response.Flush()
Response.End()

But the browser receives "application/octet-stream" as mime type! IE shows
the XLS file as html/text, and FFOX propts to save.

Why? :((

thanks

From: Mike Lovell on
> I've an application that worked well on IIS6. I moved it to IIS7, and
> response.contenttype is now ignored.
>
> my code ends with:
>
> Response.ContentType = "application/vnd.ms-excel"
>
> Response.Flush()
> Response.End()
>
> But the browser receives "application/octet-stream" as mime type! IE shows
> the XLS file as html/text, and FFOX propts to save.

Could it be related to this bug report?

https://connect.microsoft.com/VisualStudio/feedback/details/480689/response-flush-clears-content-type-header?wa=wsignin1.0

I notice you're using Flush. They suggest that if you set the Content
Length it won't happen.

--
Mike
GoTinker, C# Blog
http://www.gotinker.com

From: Trapulo on
Maybe can be, but it seems impossible that I may wait for .NET 4.0 to have
this simple and old feature running.. :((



"Mike Lovell" wrote:

> > I've an application that worked well on IIS6. I moved it to IIS7, and
> > response.contenttype is now ignored.
> >
> > my code ends with:
> >
> > Response.ContentType = "application/vnd.ms-excel"
> >
> > Response.Flush()
> > Response.End()
> >
> > But the browser receives "application/octet-stream" as mime type! IE shows
> > the XLS file as html/text, and FFOX propts to save.
>
> Could it be related to this bug report?
>
> https://connect.microsoft.com/VisualStudio/feedback/details/480689/response-flush-clears-content-type-header?wa=wsignin1.0
>
> I notice you're using Flush. They suggest that if you set the Content
> Length it won't happen.
>
> --
> Mike
> GoTinker, C# Blog
> http://www.gotinker.com
>
> .
>
From: Alexey Smirnov on
On Mar 24, 11:37 am, Trapulo <nonscrive...(a)nospam.nospam> wrote:
> Maybe can be, but it seems impossible that I may wait for .NET 4.0 to  have
> this simple and old feature running.. :((
>
>
>
> "Mike Lovell" wrote:
> > > I've an application that worked well on IIS6. I moved it to IIS7, and
> > > response.contenttype is now ignored.
>
> > > my code ends with:
>
> > >     Response.ContentType = "application/vnd.ms-excel"
>
> > >        Response.Flush()
> > >        Response.End()
>
> > > But the browser receives "application/octet-stream" as mime type! IE shows
> > > the XLS file as html/text, and FFOX propts to save.
>
> > Could it be related to this bug report?
>
> >https://connect.microsoft.com/VisualStudio/feedback/details/480689/re...
>
> > I notice you're using Flush.  They suggest that if you set the Content
> > Length it won't happen.
>
> > --
> > Mike
> > GoTinker, C# Blog
> >http://www.gotinker.com
>
> > .

Do you have Response.Clear before that code? Maybe it helps
From: Trapulo on


"Alexey Smirnov" wrote:
>
> Do you have Response.Clear before that code? Maybe it helps

I added now, but still the same :(
I forgot to say that either .Flush and .End was added to try to solve this
issue: on the IIS6 I didn't use them and all worked.

thanks

 |  Next  |  Last
Pages: 1 2
Prev: Unit Testing ASP.NET
Next: LinqToEntitiesDomainService