Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeGetting StartedGetting StartedInstalling DNN ...Installing DNN ...Nuke 4.4.0 new exceptionNuke 4.4.0 new exception
Previous
 
Next
New Post
12/27/2006 6:57 AM
 

Hi,

I've a problem with some module when trying to download files already uploaded for test purposes. It seems like some information is sent to Page before the server sends headers for download.. I work in a clean installation. Below the Exception Log.

AssemblyVersion: 04.04.00
PortalID: 0
PortalName: My Website
UserID: 1
UserName: host
ActiveTabID: 36
ActiveTabName: Home
RawURL: /Home/tabid/36/Default.aspx
AbsoluteURL: /Default.aspx
AbsoluteURLReferrer: http://dev.testing440.it/Home/tabid/36/Default.aspx
UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
DefaultDataProvider: DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider
ExceptionGUID: 0401e64a-a619-42e5-b4b2-02206616d2c8
InnerException: Server cannot append header after HTTP headers have been sent.
FileName:
FileLineNumber: 0
FileColumnNumber: 0
Method: System.Web.HttpResponse.AppendHeader
StackTrace:
Message: DotNetNuke.Services.Exceptions.PageLoadException: Server cannot append header after HTTP headers have been sent. ---> System.Web.HttpException: Server cannot append header after HTTP headers have been sent.at System.Web.HttpResponse.AppendHeader(String name, String value)at DotNetNuke.HttpModules.Compression.CompressingFilter.WriteHeaders()at DotNetNuke.HttpModules.Compression.GZipFilter.Write(Byte[] buffer, Int32 offset, Int32 count)at DotNetNuke.HttpModules.Compression.WhitespaceFilter.Write(Byte[] buffer, Int32 offset, Int32 count)at System.Web.HttpWriter.Filter(Boolean finalFiltering)at System.Web.HttpResponse.Flush(Boolean finalFlush)at System.Web.HttpResponse.Flush()at DotNetNuke.Modules.Repository.RepositoryBL.StreamFile(String FilePath, String DownloadAs)at DotNetNuke.Modules.Repository.RepositoryBL.DownloadFile(String ItemID)at DotNetNuke.Modules.Repository.Repository.lstObjects_ItemCommand(Object source, DataGridCommandEventArgs e)at System.Web.UI.WebControls.DataGrid.OnItemCommand(DataGridCommandEventArgs e)at System.Web.UI.WebControls.DataGrid.OnBubbleEvent(Object source, EventArgs e)at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)at System.Web.UI.WebControls.DataGridItem.OnBubbleEvent(Object source, EventArgs e)at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)at System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e)at System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument)at System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)--- End of inner exception stack trace ---
Source:
Server Name: DEV

As you can see in the log this problem came out in Repository Module but also in Documents and I think Media too. Thanks in advance for any help or suggestion.

 
New Post
12/27/2006 3:25 PM
 
That's right; "Server cannot append header after http headers have been sent" error message:
The problem is e.g. here:  (\Components\FileSystem\FileSystemUtils.vb)

        Public Shared Sub DownloadFile(ByVal FileLoc As String)
            Dim objFile As New System.IO.FileInfo(FileLoc)
            Dim objResponse As System.Web.HttpResponse = System.Web.HttpContext.Current.Response
            If objFile.Exists Then
                objResponse.ClearContent()
                objResponse.ClearHeaders()
                objResponse.AppendHeader("content-disposition", "attachment; filename=" + objFile.Name.ToString)
                objResponse.AppendHeader("Content-Length", objFile.Length.ToString())

                objResponse.ContentType = GetContentType(objFile.Extension.Replace(".", ""))

                WriteFile(objFile.FullName)

                objResponse.Flush()
                objResponse.Close()
            End If
        End Sub


or any other place where a similar operation is performed e.g.; my custom code:

        Private Shared Sub DownloadFile0(ByVal fullFileName As String, ByVal fileHttpContext As System.Web.HttpContext)

            Dim myFileInfo As System.IO.FileInfo
            myFileInfo = New System.IO.FileInfo(fullFileName)

            fileHttpContext.Response.Clear()
            fileHttpContext.Response.ClearHeaders()
            fileHttpContext.Response.ClearContent()

            fileHttpContext.Response.AppendHeader("Content-disposition", "attachment; filename=" & myFileInfo.Name)
            fileHttpContext.Response.AppendHeader("Content-Length", myFileInfo.Length.ToString())
            fileHttpContext.Response.ContentType = "application/octet-stream"

            fileHttpContext.Response.TransmitFile(fullFileName)

            fileHttpContext.Response.Flush()
            fileHttpContext.Response.Close()

        End Sub


ClearContent() and/or ClearHeaders() doesn't help


[HttpException (0x80004005): Server cannot append header after HTTP headers have been sent.]
   System.Web.HttpResponse.AppendHeader(String name, String value) +3209294
   DotNetNuke.HttpModules.Compression.CompressingFilter.WriteHeaders() +42
   DotNetNuke.HttpModules.Compression.GZipFilter.Write(Byte[] buffer, Int32 offset, Int32 count) +18
   DotNetNuke.HttpModules.Compression.WhitespaceFilter.Write(Byte[] buffer, Int32 offset, Int32 count) +175
   System.Web.HttpWriter.Filter(Boolean finalFiltering) +251
   System.Web.HttpResponse.FilterOutput() +60
   System.Web.CallFilterExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +29
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64

Does anybody have any clue about how to workaround this issue? or is it a core bug?

Thanks!,
hj.-
 
New Post
12/28/2006 2:47 AM
 

Thanks Horacioj,

I wonder how could be possible to release a new version with a similar bug... there's also a problem in Module Forum: a stored procedure not working as expected... (this problem is already dealt in an other thread)....

 
New Post
1/8/2007 11:25 AM
 

Ok, I've posted another thread under "Using the Document Module" reporting the same problem.

This is the link:

http://www.dotnetnuke.com/Community/ForumsDotNetNuke/tabid/795/forumid/18/threadid/94300/scope/posts/Default.aspx

there you can find some little more informations about the error. Thanks and bye.

 
Previous
 
Next
HomeHomeGetting StartedGetting StartedInstalling DNN ...Installing DNN ...Nuke 4.4.0 new exceptionNuke 4.4.0 new exception


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out