Solved

issue with downloading attachments from database and causing dupliacte errors

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This article offers some helpful and general tips for safe browsing and online shopping. It offers simple and manageable procedures that help to ensure the safety of one's personal information and the security of any devices.
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…

910 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

22 Experts available now in Live!

Get 1:1 Help Now