Solved

issue with downloading attachments from database and causing dupliacte errors

Posted on 2014-01-15
1
465 Views
Last Modified: 2014-01-21
The web application I maintain is recently causing the below error looks like for IE 10 and Chrome 32.0.1700.76  

The response from the server contained duplicate headers. This problem is generally the result of a misconfigured website or proxy. Only the website or proxy administrator can fix this issue.
Error code: ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION
(chrome error) but causing similar to IE also

Below is my code and kindly help me get resolve the issue:


                With objAttachment
                    Response.Buffer = True
                    byeTemp = .GetLSCBriefingDocument(datAgendaDate)
                    Dim strAttachment As String
                    If Not IsNothing(.FileName) Then
                        strAttachment = "attachment; filename=" & .FileName & ";"
                        Response.ClearContent()
                        Response.ClearHeaders()
                        Response.BufferOutput = True

                        Response.AddHeader("Content-Disposition", strAttachment)
                        Response.AddHeader("Content-Disposition", "inline")
                        Response.AddHeader("Content-Transfer-Encoding", "binary")

                        Response.AddHeader("Content-Length", byeTemp.Length)
                        Response.ContentType = .AttachmentType
                        Response.OutputStream.Write(byeTemp, 0, byeTemp.Length)
                        Response.Flush()
                        Response.Close()
                        Response.End()
                    Else
                        JavaScriptShowMSG("LSC Briefing Document for this meeting has not been published.")
                    End If
                End With

I tried the below but no luck:
 strAttachment = "attachment; filename=" & Chr(34) & .FileName.Replace(",", "_").Replace(" ", "_") & Chr(34)
0
Comment
Question by:welcome 123
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 39785283
You can't do this:

                   Response.AddHeader("Content-Disposition", strAttachment)
                   Response.AddHeader("Content-Disposition", "inline")

You can do inline or attachment, but not both.

Content-Disposition attachment vs inline
http://dotanything.wordpress.com/2008/05/30/content-disposition-attachment-vs-inline/
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Several part series to implement Internet Explorer 11 Enterprise Mode
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.
Shows how to create a shortcut to site-search Experts Exchange using Google in the Chrome browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch the Search Engine Menu: In chrome, via you…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question