Link to home
Start Free TrialLog in
Avatar of welcome 123
welcome 123

asked on

issue with downloading attachments from database and causing dupliacte errors

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)
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial