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

  • SEARCH
  • Home
  • 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 6795947
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:24:29+00:00 2026-05-26T18:24:29+00:00

I try to read image from database (blob) but i have problem becouse i

  • 0

I try to read image from database (blob) but i have problem becouse i don’t know mime type of image. I have only tinyblob.

Can i read image and save it back to my hard disk?

  • 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-26T18:24:29+00:00Added an answer on May 26, 2026 at 6:24 pm

    The best solution is to store the mime-type in the DB at the same time you’re inserting the image into the blob field. Otherwise you’re going to have to the following EACH TIME the image is retrieved:

    $image = $row['imageblob'];  // $row = result row from DB query.
    
    $finfo = new finfo(FILEINFO_MIME);
    $mime_type = $finfo->buffer($image);
    

    This gets to be expensive very quickly on a busy system, so best do the determination ONCE and then store that result.

    Relevant PHP docs here.

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

Sidebar

Related Questions

I have a image from files = request.FILES['new_photo'].read() and i want to know it's
I tried to create image from BLOB. I try following code but it is
I have to read image binary from database and save this image binary as
I would like to try to read some of text from an image with
I have a very big file 4GB and when I try to read it
I get a warning in MSVC++ when I try to read an integer from
In the following code, I try to read data from a plist: -(void)readPreferences {
I have stored my image as mediumblob in database In my Image bean class
I'm trying to do a simple thing; read an image from the internet, save
When I have uploaded an image from my website I need to do 2

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.