How to Solve this Server return Error.

Posted by Jayakumars under ASP.NET AJAX on 1/28/2015 | Points: 10 | Views : 2590 | Status : [Member] [MVP] | Replies : 1
hi

I download option in asp.net multiple pdf file in my page i meet this issue how to solve this

my error this

Duplicate headers received from server

he 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


MyCode like this for Download

Response.ContentType = "application/pdf";
Response.AddHeader("content-disposition", "attachment; filename="test.pdf");
Response.OutputStream.Write(fileContent, 0, fileContent.Length);

Mark as Answer if its helpful to you

Kumaraspcode2009@gmail.com



Responses

Posted by: kgovindarao523-21772 on: 1/29/2015 [Member] [MVP] Bronze | Points: 25

Up
0
Down
Hi,
Try with this:
Response.Clear() 
Response.AddHeader("Content-Type", "application/pdf")
Response.AddHeader("Cache-Control", "no-cache") ;
Response.AddHeader("Accept-Ranges", "none") ;
Response.AddHeader("Content-Disposition", "attachment; filename=test.pdf" ) ;
Response.OutputStream.Write(fileContent, 0, fileContent.Length);
Response.Flush();
Response.End() ;


Thank you,
Govind

Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response