upload file via browser

  • Thread starter Chris Henderson
  • Start date
C

Chris Henderson

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.
 
L

Louis-Philippe

[Note: parts of this message were removed to make it a legal post.]

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.
 
B

Brian Candler

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,172
Messages
2,570,934
Members
47,477
Latest member
ColumbusMa

Latest Threads

Top