mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-11-10 16:31:22 +08:00
Fix download file
This commit is contained in:
parent
b762ae6a90
commit
7e379d4e0d
2 changed files with 2 additions and 2 deletions
|
|
@ -451,7 +451,7 @@ class Asset < ApplicationRecord
|
||||||
def generate_temp_file
|
def generate_temp_file
|
||||||
tempfile = Tempfile.new
|
tempfile = Tempfile.new
|
||||||
tempfile.binmode
|
tempfile.binmode
|
||||||
tempfile << file.download
|
file.blob.download { |chunk| tempfile.write(chunk) }
|
||||||
tempfile.rewind
|
tempfile.rewind
|
||||||
tempfile
|
tempfile
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -194,7 +194,7 @@ class TinyMceAsset < ApplicationRecord
|
||||||
def generate_temp_file
|
def generate_temp_file
|
||||||
tempfile = Tempfile.new
|
tempfile = Tempfile.new
|
||||||
tempfile.binmode
|
tempfile.binmode
|
||||||
tempfile << image.download
|
image.blob.download { |chunk| tempfile.write(chunk) }
|
||||||
tempfile.rewind
|
tempfile.rewind
|
||||||
tempfile
|
tempfile
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue