vendredi 17 juin 2016

Laravel - Delete local file after served to client

I am using the following to serve a PDF file to a user return

response()->download($filename); 

Once the file has been served for download, there is no need to keep it on the server and I would like to remove it so they don't clog the server storage. What is the best way to remove the file after it has been downloaded? I was going to use terminable middleware to handle it. Is that the best way to do it with Laravel 5.1?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire