Convert file upload to UTF-8 and delete NULL byte
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user