Convert file upload to UTF-8 and delete NULL byte

This commit is contained in:
Sebastian Serth
2020-12-16 18:43:04 +01:00
parent 9fba70cde2
commit 1d0b4e327a

View File

@ -219,7 +219,7 @@ class ExercisesController < ApplicationController
file_params[:content] = nil
file_params[:native_file] = file_attributes[:content]
else
file_params[:content] = file_attributes[:content].read
file_params[:content] = file_attributes[:content].read.encode.delete("\x00")
end
end
end