?
Solved

issue with downloading attachments from database and causing dupliacte errors

Posted on 2014-01-15
1
Medium Priority
?
477 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 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Now-a-days, indirectly, postal services have been replaced by email services. Yes, whenever we hear the word "email" a lot of people only think of gmail. Some people still think that email and gmail are one and the same thing :-). Let's see some …
Internet is a big network which is formed by connecting multiple small networks.It is a platform for all the users which are connected to it.Internet act as platform in different fields. Such as: Internet  as a collaboration platform. Internet  as…
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.
How to create a custom search shortcut to site-search Experts Exchange using Google in the Firefox browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch your Bookmark Menu: Press 'Ctrl +…
Suggested Courses

762 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