Download multiple files via send_data

111 views
Skip to first unread message

Daynthan Kabilan

unread,
Mar 1, 2018, 6:05:17 AM3/1/18
to rubyonra...@googlegroups.com
Hi All,

How to download multiple files via send_data or send_files.

format.xml { send_data @records, type: "text/xml" }

I have two XML files in temp directory. currently i have ziped the folder and download as a file. But i need download the 2 files without zip concept.

If i try to download the process in loop then last file only downloaded. Can anyone help me.

Thanks
Daya

Walter Lee Davis

unread,
Mar 1, 2018, 8:16:14 AM3/1/18
to rubyonra...@googlegroups.com
You will have to initiate two separate requests from the browser (maybe Ajax or similar concept). A URL relates to one file. That's a foundation principle of the Web.

Walter
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CADKeJyQoRULWD4Y7oefk0xAagQwDXpcJMSLG3dVKSpzEFteYBQ%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages