in reply to blob output

Are you sure the actual JPG is stored in the directory where the server is looking for the picture (i.e. probably the same as the script is located in)?

($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

Replies are listed 'Best First'.
Re^2: blob output
by bigup401 (Pilgrim) on Sep 11, 2018 at 08:06 UTC

    am just polling photo from db table from blob column

    the photo is stored in db not locally. as u see the example. the photo is being polled from db bt cant display i tried to use binmod

    well i think it just needs to be decoded to display coz its in encoded type

      > as u see the example

      No, the example shows the name of the file being inserted into the src attribute of an img tag:

      <img src="02100.JPG">

      You haven't posted the schema of the table nor a sample of it, so I don't know what details you keep for each photo.

      Note that

      <img src="\@\ $ome binary trash, in fact contents of a JPG file">
      doesn't display the image in the browser. The common way is to use
      <img src="data:image/jpg;base64,..."
      where you can use MIME::Base64 to encode the binary contents.

      ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

        i selected the photo from table

        my $pic = $DBH->prepare("SELECT PHOTO FROM tble WHERE ID = ?"); $pic->execute(#ID); $pik = $pic->fetchrow;

        this is my html div where i want to display the img

        html <img src="$pik">

        this is the output. the photo i got from table where is blob column

        u can see the photo was selected successful from table and brings the photo name exactly. bt the problem it doesn;t display to browser

        output <img src="02100.JPG" #this is the photo i got from db. bt cant display +>