Forum: Ruby on Rails original_filename - where documented?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
9e6d05909dc733af570faadce1392e67?d=identicon&s=25 Michael Satterwhite (msatterwhite)
on 2007-05-23 19:33
This one is probably obvious to everyone but me.

In a file upload, I know of the "original_filename" method. I'm also
assuming there are other similar methods related to the uploaded file.
Where in heaven's name are these documented? I've looked in the rails
documentation and in the ruby documentation.

Would someone be so kind as to point me at where in the documentaion
this and related methods are documented?

Thanks much
---Michael
2f9a03aa0fcfe945229cb6126eda2cb2?d=identicon&s=25 Philip Hallstrom (Guest)
on 2007-05-23 20:04
(Received via mailing list)
> This one is probably obvious to everyone but me.
>
> In a file upload, I know of the "original_filename" method. I'm also
> assuming there are other similar methods related to the uploaded file.
> Where in heaven's name are these documented? I've looked in the rails
> documentation and in the ruby documentation.
>
> Would someone be so kind as to point me at where in the documentaion
> this and related methods are documented?

Look in the stdlib docs under CGI (then click the CGI class link)...

If a requests method is POST and its content type is
multipart/form-data,
then it may contain uploaded files. These are stored by the
QueryExtension
module in the parameters of the request. The parameter name is the name
attribute of the file input field, as usual. However, the value is not a
string, but an IO object, either an IOString for small files, or a
Tempfile for larger ones. This object also has the additional singleton
methods:

local_path():  the path of the uploaded file on the local filesystem
original_filename():  the name of the file on the client computer
content_type():  the content type of the file
This topic is locked and can not be replied to.