Re: file uploading
Shugo Maeda <[email protected]>
| Newsgroups | gmane.comp.apache.mod-ruby |
|---|---|
| Message-ID | <[email protected]> |
Hi, At Fri, 23 Jan 2004 15:49:50 -0500, Daniel Bretoi <[email protected]> wrote: > Shugo? No way of doing file uploads? > > I'm quite surprised actually. Did you read the document of cgi.rb? The following code worked for me. -- test.rhtml ---- % 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> ----- Shugo