This is a discussion on using stream_filter_append with zlib, "failed to process pre-buffered data" within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Hello, I am trying to decompress some data in a file, from PHP. It's data that has been zlib-...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hello,
I am trying to decompress some data in a file, from PHP. It's data that has been zlib-compressed on a handheld device and sent wirelessly to the PHP server. I can open the file and read some regular data from it. When I get to the position where my zlib compressed information starts, I make these calls: $zlib_filter = stream_filter_append($cellfile, 'zlib.inflate', STREAM_FILTER_READ, 1); $data = fread($cellfile, $thumblength); stream_filter_remove($zlib_filter); Is that the right way to do it? I am getting this error: stream_filter_append() [<a href='function.stream-filter-append'>function.stream-filter-append</a>]: Filter failed to process pre-buffered data. Not adding to filterchain. I put 1 for the compression level, because originally I only compress with one pass of the zlib.compress function. I hope that it is possible to use this zlib decompression from some point within a regular file. I do not want to go the route of compressing my entire file with gzip. I appreciate any tips on what I might be doing wrong. Thanks, B |