Methods
Attributes
| [R] | content_type | The content type of the "uploaded" file |
| [R] | original_filename | The filename, not including the path, of the "uploaded" file |
Public Class methods
[ show source ]
# File vendor/rails/actionpack/lib/action_controller/test_process.rb, line 328
328: def initialize(path, content_type = 'text/plain')
329: raise "#{path} file does not exist" unless File.exist?(path)
330: @content_type = content_type
331: @original_filename = path.sub(/^.*#{File::SEPARATOR}([^#{File::SEPARATOR}]+)$/) { $1 }
332: @tempfile = Tempfile.new(@original_filename)
333: FileUtils.copy_file(path, @tempfile.path)
334: end