[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

upload file via browser

Chris Henderson

6/4/2009 2:52:00 PM

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.

2 Answers

Louis-Philippe

6/4/2009 3:14:00 PM

0

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

2009/6/4 Chris Henderson <henders254@gmail.com>

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

Brian Candler

6/4/2009 3:32:00 PM

0

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
--
Posted via http://www.ruby-....