using stream_filter_append with zlib, "failed to process pre-buffered data"

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-...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-11-2007
Bint
 
Posts: n/a
Default using stream_filter_append with zlib, "failed to process pre-buffered data"

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


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:31 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0