On Tuesday, September 22, 2015 at 11:10:58 AM UTC+1, Ruby-Forum.com User wrote: > > > I have built a little webmail client, and I need to make attachments > downloadable to the users. I have the base64 ecoded rappresentation of > the file, and I don't know how to generate and send the file. > > > I have tried send_data, with disposition :attachment, but the request > take a lot of time and it doesn't even prompt the download dialog. I am > surely missing the whole point here, and I need some clarity. > > You really want to be using send_file rather than send_data, because send_data ties up your rails process sending the data whereas send_file will offload to apache/nginx if properly setup (on apache this requires the X-Sendfile module, I forget what the nginx equivalent is)
Fred -- 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 [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/fd4601aa-e93f-4ab1-a93e-19c580afbcf0%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.

