• Register
0 votes
622 views

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;
}

OR

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 4 views
4 views
Problem: Can anyone suggest me a good website to download view only pdf from website?
asked Mar 31 zayed1 61.8k points
1 vote
1 answer 6 views
6 views
Problem: Any solution for this I am facing it while exporting to pdf in chrome: Err_response_headers_multiple_content_disposition chrome.
asked Apr 27 PkGuy 23.5k points
0 votes
1 answer 2 views
2 views
Problem: Where can I look for a solution to this problem? >Invalid 'x-frame-options' header encountered when loading
asked 2 days ago Sawyer Parviz 13.2k points
0 votes
1 answer 4 views
4 views
Problem: There is enough information about HTML5 on the web (and also on stackoverflow), but now I'm curious about the "best practices". Tags like section/headers/article are new, and everyone has different opinions about when/where you should use these tags. So what do you guys ... . header with h2 line 65. Hmm, div or section? Or remove this div and only use the article-tag line 105. Footer :-)
asked May 2 Yeamin 22k points
0 votes
1 answer 6 views
6 views
Question: I have json file mydata.json, and in this file is some json-encoded data. I want obtain this data in file index.html and process this data in JavaScript. But a don't know how to connect.json file in .html file? Tell me please. Here is my json file: { " ... can display the data in tables in html page. I am using JavaScript to parse the json file. I am new to this field. Help out please.
asked Apr 15 munim01 21k points
0 votes
1 answer 6 views
6 views
Problem: Please let me know any solution regarding this issue .. content-type: application/json
asked Apr 7 Ifra 37.2k points
0 votes
1 answer 11 views
11 views
Problem: I am stuck now .. need some suggestions .. please help me .. How to check http headers in chrome?
asked Apr 7 Ifra 37.2k points
0 votes
1 answer 3 views
3 views
Problem: Please help me fix this dilemma “How to include javascript code within php script file, to execute javascript code”?
asked Mar 29 tuhin1 48.9k points
0 votes
1 answer 4 views
4 views
Problem: I tried to find out the solution on the web when I face this problem but I did not get any fruitful information that I can continue if you read the above question and understand what is the solution of this please cooperate with me- Thanks
asked Mar 24 rubelkhan 20.4k points
1 vote
1 answer 6 views
6 views
Problem: Geeks need your help with this ! Struct in header file c++.
asked Mar 23 PkGuy 23.5k points