Class: WWW::Mechanize::Form::FileUpload
- Defined in:
- lib/www/mechanize/form/file_upload.rb
Overview
This class represents a file upload field found in a form. To use this class, set WWW::FileUpload#file_data= to the data of the file you want to upload and WWW::FileUpload#mime_type= to the appropriate mime type of the file. See the example in EXAMPLES
Instance Attribute Summary collapse
-
#file_name ⇒ Object
File name.
-
#mime_type ⇒ Object
Mime Type (Optional).
Attributes inherited from Field
Instance Method Summary collapse
-
#initialize(name, file_name) ⇒ FileUpload
constructor
A new instance of FileUpload.
Methods inherited from Field
Constructor Details
#initialize(name, file_name) ⇒ FileUpload
Returns a new instance of FileUpload.
16 17 18 19 20 |
# File 'lib/www/mechanize/form/file_upload.rb', line 16 def initialize(name, file_name) @file_name = Util.html_unescape(file_name) @file_data = nil super(name, @file_data) end |
Instance Attribute Details
#file_name ⇒ Object
File name
10 11 12 |
# File 'lib/www/mechanize/form/file_upload.rb', line 10 def file_name @file_name end |
#mime_type ⇒ Object
Mime Type (Optional)
11 12 13 |
# File 'lib/www/mechanize/form/file_upload.rb', line 11 def mime_type @mime_type end |