I have a form_remote_tag that calls a method to print out a csv file
for download. If I tell the form_remote_tag to update a div the data
comes up in that div, but otherwise I can't get the browser to
acknowledge the sent file.
I have a form_remote_tag that calls a method to print out a csv file
for download. If I tell the form_remote_tag to update a div the data
comes up in that div, but otherwise I can't get the browser to
acknowledge the sent file.
Make the form a non-AJAX form, use submit_to_remote to trigger
the AJAX call to update the div, and use an ordinary submit tag
to trigger the CSV send.
I tried the same in my code. But always the browser is getting only
the action name itself as the filename and it says it cannot find the
file. Here is the code snippets from my application.
When I click on the "Export to excel button", the file is created in
the server. The browser shows the file download window. But it shows
the file name as "exportToExcel". When I click on save it shows error
message "Internet explorer cannot download exportToExcelfrom
localhost". I am running the server in localhost.
I tried the same in my code. But always the browser is getting only
the action name itself as the filename and it says it cannot find the
file. Here is the code snippets from my application.
When I click on the "Export to excel button", the file is created in
the server. The browser shows the file download window. But it shows
the file name as "exportToExcel". When I click on save it shows error
message "Internet explorer cannot download exportToExcelfrom
localhost". I am running the server in localhost.
What is missing in the code I am using?
Thanks in advance.
Thanks! That fixed things right up.
I have a form_remote_tag that calls a method to print out a csv file
for download. If I tell the form_remote_tag to update a div the data
comes up in that div, but otherwise I can't get the browser to
acknowledge the sent file.
Make the form a non-AJAX form, use submit_to_remote to trigger
the AJAX call to update the div, and use an ordinary submit tag
to trigger the CSV send.
--
We develop, watch us RoR, in numbers too big to ignore.
for filename specify your filename directly with filepath
for e.g @filepath = "C:/Rails
application/smartime/public/excel/"+"report8.xls"
and then pass this variable for filename