Upload file via browser

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)?


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. [email protected]

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

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”)

post ‘/upload’ do
… parse the params, read the file, store it to disk