Forum: Ruby on Rails Does Javascript allow download from a server to local file s

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
1e2f73355d6fb2e417e0c38e97c50cf4?d=identicon&s=25 Gilles (Guest)
on 2007-06-14 15:43
(Received via mailing list)
Does Javascript allow download from the server to the local
filesystem ?
I ask that because i am trying to initiate a file download through a
link_to_function method which contains an Ajax.Request ... Here it
is :
<%= link_to_function("Ajax Download Pic",
                                "new Ajax.Request('/main/dl_photos/
#{}?index=1', {});
") %>

The file does download as it is shown in the terminal with a Sending
XXX.jpg and status 200 Ok, but i don't see how to use the resulting
response ... i know i have to use the onComplete function(request) {},
but how can i implement the function to save the file on the desktop ?

This topic is locked and can not be replied to.