The user uploads a .tar.gz
archive and I need to validate if the archive contains a certain file (I just need to check the filename, nothing else).
I know I can open the file using \PharData
however it seems that it loads the entire archive into memory. Since the archive is a backup and can easily be bigger than memory_limit, I can't use this.
How can I do the validation without loading the whole file to memory? In case it is impossible to do in PHP (as I suspect), how can I do it in bash? Again without loading the entire file to memory at once and also without actually unpacking the archive.