Solved

issue with downloading attachments from database and causing dupliacte errors

Posted on 2014-01-15
1
453 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
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Bada platform is becoming more and more famous this days and people talking about same. Some friends included those who have bada OS mobile asked me "what is bada?"and "what its features?". That encouraged me to research and write this article. [st…
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 to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.
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…

706 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now