Kalanamith
Kalanamith

Reputation: 20648

How to create a blob to a file content and save it to postgre sql using ruby

Hi um facing an issue of creating a blob to a file and save it to a binary column in a postgre sql using rails . Still dont have an idea of how to start it. I would be happy if any one can tell me a way to do it.

file.each_line do |line|

  line = Iconv.conv('utf-8', 'ISO-8859-1', line)

I want to save a file as Binary data (as a binary large object) and the file contains string

Upvotes: 0

Views: 315

Answers (1)

phoet
phoet

Reputation: 18845

if you are looking for a gem that does this, carrier-wave should be helpflul: https://github.com/diogob/carrierwave-postgresql

Upvotes: 1

Related Questions