Fix the import of avatars and attachments

This time for real ;-)
This commit is contained in:
Gerhard Schlager 2018-08-12 22:26:07 +02:00
parent 6d813c2b52
commit 8513605421
1 changed files with 2 additions and 3 deletions

View File

@ -61,9 +61,8 @@ module ImportScripts
private
def copy_to_tempfile(source_path)
# extension = File.extname(source_path)
# tmp = Tempfile.new(['discourse-upload', extension])
tmp = Tempfile.new('discourse-upload')
extension = File.extname(source_path)
tmp = Tempfile.new(['discourse-upload', extension])
File.open(source_path) do |source_stream|
IO.copy_stream(source_stream, tmp)