module ActionDispatch::Http::Upload

def normalize_parameters(value)

file upload hash with UploadedFile objects
Convert nested Hash to HashWithIndifferentAccess and replace
def normalize_parameters(value)
  if Hash === value && value.has_key?(:tempfile)
    upload = value[:tempfile]
    upload.extend(UploadedFile)
    upload.original_path = value[:filename]
    upload.content_type = value[:type]
    upload
  else
    super
  end
end