[Mono-dev] R: Transfer-Encoding: chunked + Connection: close

Robert Jordan robertj at gmx.net
Wed Jun 28 07:55:49 EDT 2006


Hey,

Try this:

Response.AppendHeader ("Content-Disposition",
     String.Format ("attachment; filename=\"{0}\"",
         NomeAllegatoOriginale));

Robert

> Solution:
> Our web page inherit from a base class web page with some initialization code. One of the line in base class is the following:
> 
> Response.Cache.SetCacheability(System.Web.HttpCacheability.NoCache);
> 
> 
> This line is the blame of the problem.
> 
> Someone know why ?
> and why the different behaviour with IIS and Apache+Mono ?
> and more, why different behaviour with Internet Explorer and Firefox ?
> 
> Thank you.
> 
> 
> -----Messaggio originale-----
> Da: Kornél Pál [mailto:kornelpal at gmail.com] 
> Inviato: martedì 27 giugno 2006 19.17
> A: subscription.sapi; mono-devel-list at lists.ximian.com
> Oggetto: Re: [Mono-dev] Transfer-Encoding: chunked + Connection: close
> 
> Hi,
> 
> The attached example works fine for me with mod_mono and Apache. Note that 
> when
> doing this you don't need chunked encoding because you know the actual 
> content length.
> 
> Kornél
> 
> ----- Original Message ----- 
> From: "subscription.sapi" <subscription.sapi at apsystems.it>
> To: <mono-devel-list at lists.ximian.com>
> Sent: Tuesday, June 27, 2006 6:41 PM
> Subject: [Mono-dev] Transfer-Encoding: chunked + Connection: close
> 
> 
> We have problem to retrieve an attachment from a Web Page. We use the
> following code:
> 
> 
> 
> Response.ClearContent();
> 
> Response.ClearHeaders();
> 
> Response.Clear();
> 
> Response.ContentType=ContentType;
> 
> Response.AppendHeader("content-disposition", "filename=" +
> NomeAllegatoOriginale);
> 
> Response.BinaryWrite(FileBytes);
> 
> Response.Flush();
> 
> Response.End();
> 
> 
> 
> This code works well on IIS+.NET, for Internet Explorer and Firefox.
> 
> During porting operations we have noticed that doesn't work on
> Apache+Mono.
> 
> 
> 
> More precisely: work fine for firefox (it downloads the file and ask to
> save the file), but give an error on Internet Explorer (it downloads the
> file, but probably does not complete correctly the operation).
> 
> We noticed in the http response header from server, that in the
> Apache+Mono version, there is "Connection: close" (not present in
> IIS-.NET version). This is a "Transfer-Encoding: chunked", probably this
> creates the problem. For same strange reason, this is not a problem for
> Firefox, but Internet Explorer can't handle correctly the file (web
> stream).
> 
> I've read the patch of Gonzalo:
> 
> 
> 
> Author: gonzalo
> Date: 2005-06-26 01:51:18 -0400 (Sun, 26 Jun 2005)
> New Revision: 46512
> 
> 
> 
> But this doesn't seems to work. I Like also to know if this patch is
> already in the compilation monocharge-20060627.tar.gz
> <http://mono.ximian.com/daily/monocharge-20060627.tar.gz>  at
> http://mono.ximian.com/daily/, we like to create a compilation
> environment in the near future,but forn now we depend on the compiled
> version only.
> 
> 
> 
> Thank you.
> 
> 
> 
> 
> 
> 
> --------------------------------------------------------------------------------
> 
> 
>> _______________________________________________
>> Mono-devel-list mailing list
>> Mono-devel-list at lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/mono-devel-list




More information about the Mono-devel-list mailing list