I need to download images from other websites to my server. Create a ZIP file with those images. automatically start download of created ZIP file. once download is complete the ZIP file and images should be deleted from my server.
Instead of automatic download, a download link is also fine. but other logic remains same.
Any idea how many zip file downloads get interrupted and need to be continued?
If continued downloads are a small percentage of your downloads, you can delete the zip file immediately; as long as your server is still sending the file to the client, it'll remain on disk.
Once the server closes the file descriptor, the file's reference count will drop to zero, and finally its blocks on disk will be released.
But, you might spent a fair amount of time re-creating zip files if many downloads get interrupted though. Nice cheap optimization if you can get away with it.
Other solution: Delete past files before creation new zip file: