My application accepts a form to create multiple large(100’s of MB)
temporary files and then zip’s them up to send off to a user.
I have the files constructed, and the zipping working. The problem is
that if I use send_file to send the zip off to the user, I cannot
delete the file afterwards as it seems send_file forks off another
process and deletes the file before the streaming starts. I tried to
put my File.delete() in a method called by after_filter but that
caused the same issue.
I don’t want to load everything into memory and use send_data as there
is the potential for these files to be 200+ MB. If send_data accepted
a block that would be cool but it isn’t very flexible either.
Am I missing something?