Problems with displaying an image

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Joker

    Problems with displaying an image

    I found in the internet the following web page


    There is the description of the method of adding a graphical file into a
    database. When I try to display the added image from database I receive

    ÿØÿáTªExifMM* ?|Æ æî (,˜ö?i vôEastman
    Kodak CompanyDC210 Zoom (V05.00)ØØ,¹ H,»P01 10X' 'l'
     t'|' "' ¦'"'¶ ''' ' ¤'|H?( 2003:02:07
    02:04:462 (  d, ÿÿú1òÖ| ßÿ ( 5DCP00721.JPGü >@?`<¥ʶ
    `H©  HQ ˜( 

    instead of a picture. Is there any bug in the presented code or do I have to
    configure anything in my php?


  • Ville Mattila

    #2
    Re: Problems with displaying an image

    Joker wrote:[color=blue]
    > instead of a picture. Is there any bug in the presented code or do I have to
    > configure anything in my php?[/color]

    I'm rather sure that you've forgotten to send the Content-Type header
    before the data itself. The header tells browser which kind of data can
    be expected.

    Header("Content-Type: image/jpeg");

    If the header is sent and the data is still incorrect, the content-type
    header might be invalid.

    Ville

    Comment

    • micha

      #3
      Re: Problems with displaying an image

      your html has to contain some line like that
      <img src="YOUR_SCRIP T_THAT_GEGERATE S_THE_IMAGE.php ">

      and your php script that generates the image must sent the right
      header, i.e.

      header("Content-type: image/IMAGE_TYPE"); and that before any other
      output

      micha

      Comment

      Working...