Hello all
Problem happens when I try to extract blob data into JPG file.
Here is my code:
fb_table = DB[:feedbacks]
feedbacks = fb_table.where('updated_at IS NULL')
feedbacks.each{ |_feedback|
File.open(_feedback[:id].to_s+".jpg", 'w') {|f|
f.write(_feedback[:attachment]) }
}
When I open the files I saved, they seem damaged. However the files look fine
if I extract them by Firefox SQLite Manager plugin.
I am using JRuby 1.6.7 and Sequel 3.38.0
Can anyone help?
best regards
David Huang
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/sequel-talk/-/EAV2PDfC1JoJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sequel-talk?hl=en.