Display picture on the screen

Hi all,

I have taken a picture(BLOB) in the DB (sqite3), I have a problem to display picture on the screen. Can anyone help me and give me some advices please...

Thank you so much

Amritpal? Is that you?

Sure. My advice is: don't do that.

Store static images in the file system and serve them the normal way.

HTH!

no no no lol

Hi, do you have any other options for me… cuz i really have to do in this way

Thanks

Then write a controller to fetch the image data from the DB and deliver it with the appropriate content-type.

Put the URL of that controller/image in your HTML as the image source attribute.

That's it. Best of luck!

thanks i found the way to display the picture on the screen by using sent_data method to convert link

Instead of trying to re-invent the wheel, or a picture of that wheel, take a look at Paperclip or Carrierwave. Both are plugins that make storing and displaying pictures simple.

I would recommend as well to use a file system storage solution depending on the scale of the project