read() public method

Read attachment data from storage.
public read ( ) : Horde_Stream
return Horde_Stream Stream object containing data.
Exemplo n.º 1
0
 /**
  * Send data to the browser.
  *
  * @throws IMP_Compose_Exception
  */
 public function sendData()
 {
     global $browser;
     if (!$this->_atc->exists()) {
         throw new IMP_Exception(_("The linked attachment does not exist. It may have been deleted by the original sender or it may have expired."));
     }
     $data = $this->_atc->read();
     $md = $this->_atc->getMetadata();
     $browser->downloadHeaders($md->filename, $md->type, false, $data->length());
     while (!$data->eof()) {
         echo $data->substring(0, 8192);
     }
     $data->close();
 }
Exemplo n.º 2
0
 /**
  */
 public function read()
 {
     return $this->_storage->read();
 }