Fix download file

This commit is contained in:
Anton Ignatov 2019-07-29 10:24:31 +02:00
parent b762ae6a90
commit 7e379d4e0d
2 changed files with 2 additions and 2 deletions

View file

@ -451,7 +451,7 @@ class Asset < ApplicationRecord
def generate_temp_file
tempfile = Tempfile.new
tempfile.binmode
tempfile << file.download
file.blob.download { |chunk| tempfile.write(chunk) }
tempfile.rewind
tempfile
end

View file

@ -194,7 +194,7 @@ class TinyMceAsset < ApplicationRecord
def generate_temp_file
tempfile = Tempfile.new
tempfile.binmode
tempfile << image.download
image.blob.download { |chunk| tempfile.write(chunk) }
tempfile.rewind
tempfile
end