Problem is you opening a binary file and writing it somewhere on other file using ruby/rails
Solution
open file as binary and write it back
File.open(target_file, 'w+b', 0644) do |file|
file.write(destination_file.data)
end
File.open(target_file, 'w+b', 0644) do |file|
file.write(destination_file.data)
end
No comments:
Post a Comment