% require 'cgi' % @cgi = CGI.new <html> <body> % if @cgi.params['drop'].first filename: <p><% print CGI.escapeHTML(@cgi.params['drop'].first.original_filename) %></p> contents: <pre><% print CGI.escapeHTML(@cgi.params['drop'].first.read) %></pre> % end <form action="test.rhtml" method='post' enctype='multipart/form-data'> Drop Location: <input type="file" name="drop"> <input type=submit name=submit> </form> </body> </html>