Welcome to Working With Rails

 

Discussion Forums

Discuss all things Ruby on Rails with perhaps the web's most vibrant group of Ruby on Rails enthusiasts.
How to delete the temporary files automatically?
2 Posts
How to delete the temporary files automatically?

Why don't you send the generated output directly to the browser instead of storing these files?. If you really need to do it that way, a cron job like ( /5 * * * * find RAILS_HOME/tmp/ -name '.pdf' -exec rm -rf {} \; ) will solve the problem.

Hi, My Rails app has to process and generate PDF XFA files and send to the user/browser. Its working fine. But the issue is that before sending the file to the user, it creates 2 files in the rails tmp directory. If 10 requests come to the pdf_controller, the number of the temp files in the tmp directory will double and it will eat up the space. After searching around I thought that Sweeper will come to the rescue. But not much knowledge about Sweeper. So, can anyone plz suggest which way to go?

2 Posts
Login to add your message