Forum: Ruby on Rails Creating a tar file for download

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.
Elias O. (Guest)
on 2009-03-02 18:26
(Received via mailing list)

I have an action on my controller named download which creates a tar
file and then sends the file (via send_file) to the user. Its working
but I will like to delete the file once it is sent. The tar file
should be temporary and only available for download and then deleted
from the server. Any idea on how to do this?

def download
  @app = App.find params[:id]
  system('cd '+$removed_email_address@domain.invalid+' && tar -cf 
  send_file $global_path+"#{}/#{}.tar"
Elias O. (Guest)
on 2009-03-02 23:11
(Received via mailing list)
Basically I just want to be able to delete the file one it is
download. Any ideas?
This topic is locked and can not be replied to.