IMP_Compose_Attachment_Storage::write PHP Method

write() public method

Write attachment to storage.
public write ( string $filename, Horde_Mime_Part $part )
$filename string Filename containing attachment data.
$part Horde_Mime_Part Mime part object containing attachment metadata.
    public function write($filename, Horde_Mime_Part $part)
    {
        $this->_tmpfile = $filename;
        $this->_write($filename, $part);
    }

Usage Example

Example #1
0
 /**
  */
 public function write($filename, Horde_Mime_Part $part)
 {
     global $conf, $injector;
     if (filesize($filename) < intval($conf['compose']['link_attach_threshol'])) {
         $factory = $injector->getInstance('IMP_Factory_ComposeAtc');
         $this->_storage = new $factory->classAtc($this->_user, $this->_id);
     }
     $this->_storage->write($filename, $part);
 }