Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7664475
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T14:18:56+00:00 2026-05-31T14:18:56+00:00

I have an image (jpeg) stored in my DB (SQL Server) and when I

  • 0

I have an image (jpeg) stored in my DB (SQL Server) and when I read it I got a hex code. But I can’t display it to the browser, it doesn’t understand and shows the pure code.

Here’s a hex code example

I need help to achieve this. Thank you all in adv.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T14:18:57+00:00Added an answer on May 31, 2026 at 2:18 pm

    If you have PHP >= 5.4 you can use hex2bin().

    If not you can use the alternative function posted on that page:-

    /**
     * Converts the hex representation of data to binary
     *
     * http://www.php.net/manual/en/function.hex2bin.php
     *
     * @param   string  $str        Hexadecimal representation of data
     *
     * @return  string              Returns the binary representation of the given data
     */
    public function hex2bin($data)
    {
        $bin    = "";
        $i      = 0;
        do {
            $bin    .= chr(hexdec($data{$i}.$data{($i + 1)}));
            $i      += 2;
        } while ($i < strlen($data));
        return $bin;
    }
    

    Then you just set your headers and echo the result out to the browser.

    You’d be surprised what you can learn just by looking at the PHP manual. Hopefully, this will work for you, or at least set you on the right track.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can i compress and image file(*bmp,*jpeg) in C#, I have to display some
I have this JPEG image , that opens fine in Picasa, Photoshop, web browser,
I have pictures of each employee stored in SQL database with Image database. Select
I have a JPEG image (actually a BLOB in a database) which I want
I have a jpeg image in a char[] buffer in memory, all I need
I have the following text: --------------030805090908050805080502 Content-Type: image/jpeg Content-Transfer-Encoding: base64 Content-ID: <part16.07030906.00090703@highcontrast.ro> /9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAARgAA/+4ADkFkb2JlAGTAAAAA /9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAARgAA/+4ADkFkb2JlAGTAAAAA
I have a 2MB JPEG image, and when I use the option Image >
I have a lot of jpeg files with varying image size. For instance, here
I have a set of jpeg images where each image has an associated description.
i have a problem with uploading. if ((($_FILES[file][type] == image/gif) || ($_FILES[file][type] == image/jpeg)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.