1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Duplicate headers received from server

Discussion in 'PHP' started by shabbir, Feb 21, 2013.

  1. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,283
    Likes Received:
    364
    Trophy Points:
    83
    Viewing an image through PHP code in Chrome says Duplicate headers received from server but works fine in FF and even in IE9

    The detail of the error is :

     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,283
    Likes Received:
    364
    Trophy Points:
    83
    For those who encounter the same issue here is what is causing the issue and what could be the possible solution.

    The issue is normally when you have a PHP page that displays an image you have the header as

    Code:
    Content-Disposition: Inline; filename=someimagefilename.imageextensions
    Now if you have a filename containing a comma then above headers becomes

    Code:
    Content-Disposition: Inline; filename=someimagefilename,somecharacters.imageextensions
    And this causes chrome to throw an error of double headers - ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOS ITION

    To fix the issue just delete the current file and upload a new file that does not have the comma in the file name or make your code such that if they have comma they are replaced.

    Hope it helps.
     
    ManzZup likes this.

Share This Page