No need to save your data in a file. Just use send_data [1].
Christian
[1] http://api.rubyonrails.org/classes/ActionController/Streaming.html#M000624
On Thu, Sep 11, 2008 at 7:11 PM, Michael Lavrisha
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:>
> Hello,
>
> In my application I would like the user to download a file that is
> dynamically created from the database. Currently, I have rails put all
> the text into one variable and then save that to a temporary file with a
> filename that is generated from a sha1.
>
> If a user requests a file, is there a way to automatically delete that
> temporary file when it is done downloading or should I just set up a
> cron job?
>
> Or, if you have any other suggestion on how to send a file to a user
> there would be greatly appreciated.
>
> Thanks,
> Mike
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---