Recent Changes - Search:

Documents

Community

Related Projects

Powered by PmWiki

BinaryData

Hessian is a binary protocol and with it you can send and receive binary data in an easy way. In the current implementation, a resource variable that comes from a fopen() call will get sent as a binary stream. The only condition is that the file pointer is valid and is located at the start of the file. Here is an example taken from the standard tests of the distribution:

function viewKitty(){
  $handle = fopen('Kitty_sniper.jpg', 'rb');
  $fileinfo = array('mime_type' => 'image/jpeg', 'image' => $handle);
  return $fileinfo;
}

The method returns an array with a string with the mime type of the file and a file pointer to the file itself. Internally, HessianPHP will open the file for reading and will send it's contents in chunks. Make sure you a look at the fileService.php and imageloader.php files for more information.

TODO: More examples of this

Edit - History - Print - Recent Changes - Search
Page last modified on December 31, 2005, at 06:11 AM

PmWiki can't process your request

Cannot acquire lockfile

We are sorry for any inconvenience.