Skip to content

Commit

Permalink
Flush tempfile after populating it
Browse files Browse the repository at this point in the history
Ensure that other processes like ImageMagick and FFmpeg see the complete contents of the file.
  • Loading branch information
georgeclaghorn committed Apr 23, 2018
1 parent ef5902a commit e4c5186
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions activestorage/lib/active_storage/downloading.rb
Expand Up @@ -27,6 +27,7 @@ def open_tempfile_for_blob
def download_blob_to(file) #:doc:
file.binmode
blob.download { |chunk| file.write(chunk) }
file.flush
file.rewind
end

Expand Down

0 comments on commit e4c5186

Please sign in to comment.