Hello guys,
I am having the option to download certain folders on my app in zip format. So every time a user requests one I'm doing a system call to zip the folder (ex: system('cd '+path+' && zip ...) and then the send_file method to send it.
What happens is that I'm keeping track of disk space so I need to delete the zip immediately. I was wondering if there is a way of creating the zip file in a sort of tmp directory and send it via send_file from the tmp path. I don't know when the file transfer is over to delete the zip file and having a cron job to delete zip files is not an option (disk space could be surpassed by the zip file and the user will have to wait for it to be deleted to be able to create new files). Can anyone point me in the right direction please. Thanks,
Elías