I need to put image files from filesystem to mysql database. I don't have to upload images, they are in the server filesystem already. I tried such code in my model , but it don't work:
f = File.open(File.join(iconDirPath, filename)) data = Mysql.escape_string(f.read()) self.icon = data self.save
Model "Document" has binary field :icon, where I tried to save data from file, but it only save small portion (190 - 400 bytes).