http://manuals.rubyonrails.com/read/chapter/79
http://manuals.rubyonrails.com/read/chapter/78
http://manuals.rubyonrails.com/read/chapter/77
http://www.practicalecommerce.com/blogs/post/432-Multiple-Attachments-in-Rails
http://izumi.plan99.net/blog/index.php/2007/04/07/ruby-on-railss-handling-of-uploaded-files/
About the uploaded file object
While the uploaded file is a special beast,it is not difficult to use. The object
rails receives are processed by a CGI object. The object that CGI returns to Rails
isn’t actually a file object, but it’s close enough for our purposes.
Details from the CGI class documentation
... 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
沒有留言:
張貼留言