# Csv file transfer with form\_remote\_tag?

**URL:** <https://www.ruby-forum.com/t/csv-file-transfer-with-form-remote-tag/196676>\
**Category:** Rails\
**Created:** [May 9, 2008, 4:40pm UTC](https://www.ruby-forum.com/t/csv-file-transfer-with-form-remote-tag/196676 "2008-05-09T16:40:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kampers](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/54ee81/32.png) [@kampers](https://www.ruby-forum.com/u/kampers)\
**Post date:** [May 9, 2008, 4:40pm UTC](https://www.ruby-forum.com/t/csv-file-transfer-with-form-remote-tag/196676/1 "2008-05-09T16:40:30Z")

</div>

Good morning! I have a case where I need to build a csv file from my  
model and allow a user to download/save that file. I’ve got this all  
working with non-Ajax forms, but the generation of the csv file can take  
quite a bit of time, so I want to provide a busy indicator for my user.  
So I tried the following in my view:

\<% form\_remote\_tag ( :url =\>{:action =\> ‘all\_open’},  
:update =\> “test” ,  
:before =\> “Element.show(‘busy\_indicator’)”,  
:complete =\> “Element.hide(‘busy\_indicator’)”) do %\>  
\<%= submit\_tag ‘Save Report’, {:name =\> ‘save\_report’} %\>  
\<% end %\>

which only updates the “test” div, as I expected (but this isn’t what I  
want since the data is already displayed in a pretty table on the page).  
I googled and found suggestions to try send\_file, but since I’m building  
my csv from a model and don’t want to save the file server-side, this  
won’t work. I also found [Can't download files with send\_data or send\_file - Rails - Ruby-Forum](http://www.ruby-forum.com/topic/111107), but  
I need the busy indicator so user’s don’t mash the save button  
incessantly. Is there any way at all to pop up my busy\_indicator and  
still start the file download?

Any help/advice would be greatly appreciated (especially if it’s  
quick…this is the last thing I need to fix before deploying the  
app:)).

Thanks in advance!

-Chris

---

<div class="post-metadata">

**Author:** ![kampers](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/54ee81/32.png) [@kampers](https://www.ruby-forum.com/u/kampers)\
**Post date:** [May 9, 2008, 4:49pm UTC](https://www.ruby-forum.com/t/csv-file-transfer-with-form-remote-tag/196676/2 "2008-05-09T16:49:13Z")

</div>

On May 9, 3:40 pm, Chris K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Good morning! I have a case where I need to build a csv file from my  
> model and allow a user to download/save that file. I’ve got this all  
> working with non-Ajax forms, but the generation of the csv file can take  
> quite a bit of time, so I want to provide a busy indicator for my user.  
> So I tried the following in my view:

Ajax forms can’t upload files. It’s worth trying an ordinary form with  
an onSubmit that shows your spinner (don’t forget to return true from  
the onSubmit).

Fred
