From 7e379d4e0dcd7ace0691435a8a827db64a2e9c7c Mon Sep 17 00:00:00 2001 From: Anton Ignatov Date: Mon, 29 Jul 2019 10:24:31 +0200 Subject: [PATCH] Fix download file --- app/models/asset.rb | 2 +- app/models/tiny_mce_asset.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/asset.rb b/app/models/asset.rb index eaeedc0df..316e0b978 100644 --- a/app/models/asset.rb +++ b/app/models/asset.rb @@ -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 diff --git a/app/models/tiny_mce_asset.rb b/app/models/tiny_mce_asset.rb index 70f0dda5b..5bdd455b1 100644 --- a/app/models/tiny_mce_asset.rb +++ b/app/models/tiny_mce_asset.rb @@ -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