Methods
N
Attributes
[R] content_type

The content type of the “uploaded” file

[R] original_filename

The filename, not including the path, of the “uploaded” file

Class Public methods
new(path, content_type = 'text/plain')
# File rails/actionpack/lib/action_controller/test_process.rb, line 331
def initialize(path, content_type = 'text/plain')
  raise "#{path} file does not exist" unless File.exist?(path)
  @content_type = content_type
  @original_filename = path.sub(%r^.*#{File::SEPARATOR}([^#{File::SEPARATOR}]+)$/) { $1 }
  @tempfile = Tempfile.new(@original_filename)
  FileUtils.copy_file(path, @tempfile.path)
end