read() public méthode

Read attachment data from storage.
public read ( ) : Horde_Stream
Résultat Horde_Stream Stream object containing data.
Exemple #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();
 }
Exemple #2
0
 /**
  */
 public function read()
 {
     return $this->_storage->read();
 }