# Send\_file using AJAX

**URL:** <https://www.ruby-forum.com/t/send-file-using-ajax/163927>\
**Category:** Rails\
**Created:** [March 26, 2009, 7:25am UTC](https://www.ruby-forum.com/t/send-file-using-ajax/163927 "2009-03-26T07:25:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sudhi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/dbc845/32.png) [@sudhi](https://www.ruby-forum.com/u/sudhi)\
**Post date:** [March 26, 2009, 7:25am UTC](https://www.ruby-forum.com/t/send-file-using-ajax/163927/1 "2009-03-26T07:25:45Z")

</div>

I have a AJAX based form and when I use send\_file there is no pop-up  
that appears to prompt user to download file… how do I fix this?

Regards,  
Sudhindra

---

<div class="post-metadata">

**Author:** ![sudhi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/dbc845/32.png) [@sudhi](https://www.ruby-forum.com/u/sudhi)\
**Post date:** [March 26, 2009, 8:50am UTC](https://www.ruby-forum.com/t/send-file-using-ajax/163927/2 "2009-03-26T08:50:44Z")

</div>

On 26 Mar., 07:25, Sudhi K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> I have a AJAX based form and when I use send\_file there is no pop-up  
> that appears to prompt user to download file… how do I fix this?

[http://www.catb.org/~esr/faqs/smart-questions.html#beprecise](http://www.catb.org/~esr/faqs/smart-questions.html#beprecise)

–  
Best regards,  
David K.  
[http://twitter.com/rubyguy](http://twitter.com/rubyguy)

---

<div class="post-metadata">

**Author:** ![sudhi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/dbc845/32.png) [@sudhi](https://www.ruby-forum.com/u/sudhi)\
**Post date:** [March 26, 2009, 12:54pm UTC](https://www.ruby-forum.com/t/send-file-using-ajax/163927/3 "2009-03-26T12:54:40Z")

</div>

Sudhi K. wrote:

> I have a AJAX based form and when I use send\_file there is no pop-up  
> that appears to prompt user to download file… how do I fix this?

Did you Google for that first? It’s a FAQ in Ajax-land, because browsers  
have  
security constraints that prevent JavaScript from manipulating file  
input elements.

The answer is do old-fashioned Ajax that bypasses JavaScript. When a  
form’s  
target field is the name of a 1-pixel

Google for that FAQ to learn how to update your page after the call,  
because I  
forget.

–  
Phlip  
[http://www.zeroplayer.com/](http://www.zeroplayer.com/)
