1 module ActionController
3 def self.included(base
)
5 attr_accessor
:original_path, :content_type
6 alias_method
:local_path, :path
10 def self.extended(object
)
12 attr_accessor
:original_path, :content_type
13 alias_method
:local_path, :path
17 # Take the basename of the upload's original filename.
18 # This handles the full Windows paths given by Internet Explorer
19 # (and perhaps other broken user agents) without affecting
20 # those which give the lone filename.
21 # The Windows regexp is adapted from Perl's File::Basename.
23 unless defined? @original_filename
25 unless original_path
.blank
?
26 if original_path
=~
/^(?:.*[:\\\/])?(.*)/m
29 File
.basename original_path
37 class UploadedStringIO
< StringIO
41 class UploadedTempfile
< Tempfile