# File download in Rails

**URL:** <https://www.ruby-forum.com/t/file-download-in-rails/133244>\
**Category:** Ruby\
**Created:** [March 29, 2008, 7:27am UTC](https://www.ruby-forum.com/t/file-download-in-rails/133244 "2008-03-29T07:27:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wujciol](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/f475e1/32.png) [@wujciol](https://www.ruby-forum.com/u/wujciol)\
**Post date:** [March 29, 2008, 7:27am UTC](https://www.ruby-forum.com/t/file-download-in-rails/133244/1 "2008-03-29T07:27:18Z")

</div>

I’ve got problem with allow user to download file.

This is sending method:

class DownloadController \< ApplicationController  
def send  
@headers[“Content-Type”] =  
("./public/files/"+params[:path]+"/"+params[:name]).content\_type  
send\_file(("./public/files/"+params[:path]+"/"+params[:name]), :type  
=\>  
param[:name].content\_type)  
end  
end

In view i have:

\<%= link\_to st, :controller =\> “download”, :action =\> “send”, :path =\>  
s,  
:name =\> st %\>

I get error:

Status: 500 Internal Server Error Content-Type: text/html 500 Internal  
Server Error
