WDDX and binary data

From: Date: Fri, 14 Sep 2001 21:22:35 +0000
Subject: WDDX and binary data
Groups: php.general 
Request: Send a blank email to php-general+get-67412@lists.php.net to get a copy of this message
Despite the fact that PHP's WDDX functions don't support a "binary" type, most binary data comes through just fine, and in fact, the WDDX serialize function can encode certain types of binary data, such as a null character: <char code='00'/> But the deserialize process dos not retain these characters. Is this a bug in PHP's implementation of WDDX, or is there perhaps a workaround available? Here's some example code that shows a WDDX packet of encoded binary data. The packet itself contains all of the binary data, including null characters, etc. The deserialized() string, however, does not. <?php $fp = fopen("http://www.php.net/gifs/php_logo.gif","r"); while (!feof($fp)) { $str .= fread($fp, 4096); } $packet = wddx_serialize_value($str, "php_logo.gif"); Header("Content-Type: image/gif"); $str = wddx_deserialize($packet); echo $str; ?> -- /chris/

« previous php.general (#67412) next »