method
new
v4.2.7 -
Show latest stable
- Class:
ActionDispatch::Http::UploadedFile
new(hash)public
No documentation available.
# File actionpack/lib/action_dispatch/http/upload.rb, line 26
def initialize(hash) # :nodoc:
@tempfile = hash[:tempfile]
raise(ArgumentError, ':tempfile is required') unless @tempfile
@original_filename = hash[:filename]
if @original_filename
begin
@original_filename.encode!(Encoding::UTF_8)
rescue EncodingError
@original_filename.force_encoding(Encoding::UTF_8)
end
end
@content_type = hash[:type]
@headers = hash[:head]
end