I have a 600mb+ xyz.txt.gz file in my server that i want to extract directy in a file format (not reading the content into a string and then writing it to a file). I know that the content in the xyz.txt.gz after unzipping is xyz.txt
Reading to a string and then writing to a file cause memory overload.
I have been able to unzip a xyz.zip file using the extractTo() provided by the ZipArchive extention but there is no such function under Zlib in php.
I vaguely recall that there is a filesize limit set somewhere, the easiest method would be to use exec or shell [uk.php.net ] I know that using an external program (make sure that the host/server has it installed obviously) will be ALOT quicker.
Other than that, make sure that the zip format is done as .zip, that is though assuming as you are doing the zipping or can direct people that this is the only acceptable compression format.
Whenever I do file compression coding I always state that zip type is the only supported type that I work with, this then makes sure I don't get any coding headaches, though I am sure if I looked into it in more detail I could work out other ways - the joys of learning ;-p
Msg#: 4114493 posted 10:34 am on Apr 13, 2010 (gmt 0)
hi Matthew1980, thanks for the response. Well there is no way by which i can get the file in a .zip format. So i am only left with the option to use the .txt.gz file only. I went through the links that you provided and would like to know how do i use the exex() to uncompress the .txt.gz file ? Please guide.