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.
I need help to achieve this. Thank you all in adv.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
If you have PHP >= 5.4 you can use hex2bin().
If not you can use the alternative function posted on that page:-
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.