Uploading file directly to the server

hello everyone,

My problem is how to upload .txt file directly to the server. I wonder
if there is cgi script in ruby that first check a .txt file in a folder
in your local machine then if it exist it will be uploaded directly to
the server without using any forms and no html. I think a cgi script can
do that but i dont know how to start?

thanks