# Posting a file to a controller action using wget

**URL:** <https://www.ruby-forum.com/t/posting-a-file-to-a-controller-action-using-wget/120328>\
**Category:** Rails\
**Created:** [November 15, 2007, 8:12pm UTC](https://www.ruby-forum.com/t/posting-a-file-to-a-controller-action-using-wget/120328 "2007-11-15T20:12:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![emmanueloga](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ecae2f/32.png) [@emmanueloga](https://www.ruby-forum.com/u/emmanueloga)\
**Post date:** [November 15, 2007, 8:12pm UTC](https://www.ruby-forum.com/t/posting-a-file-to-a-controller-action-using-wget/120328/1 "2007-11-15T20:12:24Z")

</div>

Hi. i have this runnig:

class MainController \< ActionController::Base  
def load\_data  
end  
end

From my linux box, i do:  
wget [http://localhost/main/load\_data](http://localhost/main/load_data) --post-file file\_name.txt

Wich works great! the proble is, in the params, i receive:  
{ “file\_name.txt contents” =\> “”, “action” =\> “load\_data”, etc… }

Do anybody knows a better way to do the same thing but in a way that  
could produce the params:  
{ “file\_data” =\> “file\_name.txt contents”, “action” =\> “load\_data”,  
etc… }

or something like that?

Thanks!
