# Problems with link\_to\_remote and send\_file

**URL:** <https://www.ruby-forum.com/t/problems-with-link-to-remote-and-send-file/127830>\
**Category:** Rails\
**Created:** [February 1, 2008, 5:32pm UTC](https://www.ruby-forum.com/t/problems-with-link-to-remote-and-send-file/127830 "2008-02-01T17:32:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jimache](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/c67d28/32.png) [@jimache](https://www.ruby-forum.com/u/jimache)\
**Post date:** [February 1, 2008, 5:32pm UTC](https://www.ruby-forum.com/t/problems-with-link-to-remote-and-send-file/127830/1 "2008-02-01T17:32:01Z")

</div>

Hi everyone,

I working on an app that at some point generates an xls report(charts,  
summary lines, etc) and sends it to the user.  
If i use link\_to everything works fine; however when change to  
link\_to\_remote so i can make an ajax call it doesn;t seam to work ( i  
do not get the save/open dialog box)

def exp\_to\_excel\_2003  
@filepath = “#{RAILS\_ROOT}/public/files/Metrics Report.xls”  
send\_file(@filepath ,  
:disposition =\> ‘attachment’,  
:filename =\> “Metrics Reports.xls”,  
:encoding =\> ‘utf8’,  
:type =\> ‘application/octet-stream’)  
end

Can anyone help?! Any input is appreciated.

Thank you,

---

<div class="post-metadata">

**Author:** ![jimache](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/c67d28/32.png) [@jimache](https://www.ruby-forum.com/u/jimache)\
**Post date:** [February 4, 2008, 9:31am UTC](https://www.ruby-forum.com/t/problems-with-link-to-remote-and-send-file/127830/2 "2008-02-04T09:31:09Z")

</div>

I’m looking for a way to do this as well. The closest example I’ve found  
is this method to play an mp3 file inline with link\_to\_remote:

[http://rubyforge.org/pipermail/mongrel-users/2007-March/003281.html](http://rubyforge.org/pipermail/mongrel-users/2007-March/003281.html)

Haven’t found a simple solution that does what we’re looking for though.

---

<div class="post-metadata">

**Author:** ![jimache](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/c67d28/32.png) [@jimache](https://www.ruby-forum.com/u/jimache)\
**Post date:** [June 14, 2008, 7:54am UTC](https://www.ruby-forum.com/t/problems-with-link-to-remote-and-send-file/127830/3 "2008-06-14T07:54:26Z")

</div>

I’m currently having this problem as well. Any guidance would be much  
appreciated.

On Feb 4, 4:31 am, Peter M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
