• Register
0 votes

Problem :

I encountered below error while I was trying to export to pdf in the chrome browser.

Duplicate headers received from server
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 349 (net::ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION): Multiple distinct Content-Disposition headers received. This is disallowed to protect against HTTP response splitting attacks.

How can I fix above error?

7 5 2
3,870 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

I had also faced the similar issue in the recent past. I did lot of research on it and found the solution on it. This is the very common problem with the people getting started. You need to do a replace on the commas to just remove them and you should be all right. The function to make the valid filename is as below.

public static string MakeTheValidFileName(string myname)
string myinvalidChars = Regex.Escape(new    string(System.IO.Path.GetInvalidFileNameChars()));
string myinvalidReStr = string.Format(@"[{0}]+", myinvalidChars);
string myreplace = Regex.Replace(myname, myinvalidReStr, "_").Replace(";", "").Replace(",", "");
return myreplace;


You need to just put the pair of double quotes around the file name as shown below:

this.Response.AddHeader("Content-disposition", $"attachment; filename=\"{outputFileName}\"");

Hope the above solutions provided resolve the issue you are currently facing.

9 7 4
38,600 points

Related questions

0 votes
1 answer 5 views
Problem: I am getting the below exception when I run my mvn install. I have even deleted the local repository and ran again getting same exception. [ERROR] Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:2.1:shade (default) on project cores-batch: Error creating shaded jar: invalid LOC header (bad signature) -> [Help 1]
asked Feb 17 Ali 4.3k points
0 votes
1 answer 13 views
Problem: know about what is dos.h header file in c++
asked Feb 13 jasimchaudary 640 points
1 vote
1 answer 43 views
Problem : I have recently started working on the User-Agent based shared-session protection which works between sub domains. I am working on two sub domains first one is example.com and and second is sub.example.com I am receiving below USER-AGENT header “ ... HTTP Header which was sent to each domain was different. Is there anybody who can tell me the reason behind such strange behavior?
asked Mar 31, 2020 morrisBson 3.2k points
0 votes
1 answer 5 views
Problem: whoops there was a problem previewing this document
asked 6 days ago Shovo210 2.1k points
0 votes
1 answer 3 views
Problem: When I run the code, I get the following output which is different from that included in the PDF document: !"#$%#$%&%$&'()*%+,-%./01'*23%4 5'%1$#26%3/%7/))/8%&)/26%8#3"%3"*%313/9#&) % How can I extract the text as is in the PDF document?
asked Jan 23 Mashhoodch 9.1k points
0 votes
1 answer 37 views
0 votes
1 answer 19 views
0 votes
1 answer 128 views
I just forget my Number . So i need to get it by programmatically.
asked Sep 29, 2020 Daniel Anderson 4k points
0 votes
1 answer 38 views
I am running a photo collage project on Android. I need to know how to implement the collage effect?
asked Sep 25, 2020 Daniel Anderson 4k points
0 votes
1 answer 17 views
I have a mobile friendly blog. There is different layout i need to set it according android layout. That will fit in all screen sizes? Can any one here show me the path how to do it?
asked Sep 25, 2020 Daniel Anderson 4k points