IMP_Compose_Attachment_Storage::read PHP Méthode

read() public méthode

Read attachment data from storage.
public read ( ) : Horde_Stream
Résultat Horde_Stream Stream object containing data.
    public function read()
    {
        return isset($this->_tmpfile) && is_readable($this->_tmpfile) ? new Horde_Stream_Existing(array('stream' => fopen($this->_tmpfile, 'r'))) : $this->_read();
    }

Usage Example

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();
 }
All Usage Examples Of IMP_Compose_Attachment_Storage::read