You must Sign In to post a response.
  • Category: ASP.NET

    How to Solve this Duplicate Response "ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION"


    Are you looking for a way to resolve error "ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION" ? then read this thread to know how to resolve it



    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);
  • #756022
    The browsers who ignores duplicate headers can not give this error, this error will occur only for specific browsers
    May be the Chrome has the issue
    to resolve this you need to do couple of things
    1. Enclose filename using "". i.e
    header('Content-Disposition: attachment; filename="'file_name.'"');
    //instead of
    header('Content-Disposition: attachment; filename='file_name);

    2. If possible replace spaces and commas (,) with underscores (_) from filename

    Thanks
    Koolprasd2003
    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]

  • #756025
    hi
    Prasad

    My File test.pdf and try to remove space

    but same issue came in Chrome browser.

    How to solve this

    Name : Dotnet Developer-2015
    Email Id : kumaraspcode2009@gmail.com

    'Not by might nor by power, but by my Spirit,' says the LORD Almighty.

  • #756104
    There are a couple of solution for this you can try these to fix the issue you are facing.



    1. Enclose filename using "". i.e

    header('Content-Disposition: attachment; filename="'.$file_name.'"');

    instead of

    header('Content-Disposition: attachment; filename='.$file_name);

    2. If possible replace spaces and commas (,) with underscores (_)

    $file_name = str_replace(array('"', "'", ' ', ','), '_', $file_name);

    3. Explicitly tell PHP to override headers by setting optional replace parameter to true.

    header('Content-type: application/pdf', true);

    Thanks & Regards
    Anil Kumar Pandey
    Microsoft MVP, DNS MVM

  • #769871
    I've read the book and really enjoyed <a rel="dofollow" href="http://www.google.com/">Google</a> it.


  • Sign In to post your comments