Forum: Ruby upload file via browser

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.
Chris H. (Guest)
on 2009-06-04 18:55
(Received via mailing list)
I want to write a program to let people upload files to my computer
via a browser (www.mydomain.tld/upload) - what do I need in order to
write this code? Do I need to use RoR (I think RoR would be an
overkill in this situation)?

Thanks.
Louis-Philippe (Guest)
on 2009-06-04 19:14
(Received via mailing list)
only for file uploading,  the most efficient way would be with rack.Look
around for file uploading middleware.

If you want just a bit more sugar, try sinatra.

2009/6/4 Chris H. <removed_email_address@domain.invalid>
Brian C. (Guest)
on 2009-06-04 19:31
For just an occasional file upload, even a CGI would be fine -
especially if you have a web server already running with a cgi-bin
directory.

Otherwise, if you want a standalone ruby process accepting uploads, I
agree that sinatra would be the easiest way to get going.

get '/upload' do
  ... display a HTML page with a form (enctype="multipart/form-post")
end

post '/upload' do
  ... parse the params, read the file, store it to disk
end
This topic is locked and can not be replied to.