Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Dec 2007
    Posts
    269
    Thanks
    28
    Thanked 0 Times in 0 Posts

    preview from ddb

    after upload image into mysql db i ca download it like following

    PHP Code:
                while($row $result->fetch_assoc()) {
                    echo 
    "
                        <tr>
                            <td><img src=\"#\"/></td>
                            <td>{$row['name']}</td>
                            <td>{$row['mime']}</td>
                            <td>{$row['size']}</td>
                            <td>{$row['created']}</td>
                            <td><a href='get_file.php?id={$row['id']}'>Download</a></td>
                        </tr>"
    ;
                } 
    how can i preview them ?

  • #2
    New Coder
    Join Date
    Feb 2012
    Posts
    29
    Thanks
    1
    Thanked 1 Time in 1 Post
    may it work with gd2

    PHP Code:
    $img =imagecreatefromjpeg(path_to_img);
    header('Content-Type: image/jpeg');
    imagejpeg($image); 

  • #3
    Regular Coder
    Join Date
    Dec 2007
    Posts
    269
    Thanks
    28
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by chose View Post
    may it work with gd2

    PHP Code:
    $img =imagecreatefromjpeg(path_to_img);
    header('Content-Type: image/jpeg');
    imagejpeg($image); 

    it gives broken image error

  • #4
    Regular Coder
    Join Date
    Apr 2004
    Posts
    298
    Thanks
    0
    Thanked 23 Times in 23 Posts


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •