Tarun Kumar
Tarun Kumar

Reputation: 518

Is there a more space efficient way of storing images in a DB other than as a blob?

In what formats can image be saved in database else than blob ? I know we can save it as blob type .The easiest way . But is there any other way possible . becuase using php in every case we convert the image into a string . than save it .

SO someone with a different answer ?

Upvotes: 0

Views: 301

Answers (1)

ikudeljnj
ikudeljnj

Reputation: 154

You could covert them to Base64 and store them as strings. However, the practice of storing images in DB is not something that is usually done for several reasons:

  1. It's easier to store pictures on a server and then have paths stored in DB
  2. Can't really index these pictures well
  3. DB's grow too fast, can't replicate or backup efficiently

Hope this helps.

Upvotes: 4

Related Questions