list($this->width , $this->height) = $imgs;
}
}
+ print_r($this->mimetype);exit;
+ if($this->mimetype == 'application/pdf'){
+
+ require_once 'System.php';
+
+ $this->no_of_pages = 0;
+
+ $pdfinfo = System::which('pdfinfo');
+
+ if (!empty($pdfinfo)) {
+
+ $cmd = "{$pdfinfo} {$file}";
+
+ $ret = `$cmd`;
+
+ $info = explode("\n", $ret);
+
+ foreach ($info as $i){
+
+ if(!preg_match('/^Pages:[\s]?([0-9]+)/', $i, $matches)){
+ continue;
+ }
+ print_R($matches);exit;
+ $ret = (empty($matches[1])) ? false : $matches[1];
+ break;
+ }
+ }
+
+ }
$this->filesize = filesize($file);
$this->created = date('Y-m-d H:i:s');
$roo->jerr("File upload failed : error = ". (!empty($this->err) ? $this->err : ''));
}
- $roo->addEvent("ADD", $this, $this->toEventString());
+ $this->addEvent($ar, $roo);
$r = DB_DataObject::factory($this->tableName());
$r->id = $this->id;
$roo->loadMap($r);
$r->limit(1);
$r->find(true);
- $roo->jdata($r->toArray());
+ $roo->jok($r->toArray());
}
+ function addEvent($ar, $roo)
+ {
+ $roo->addEvent("ADD", $this, $this->toEventString());
+ }
+
function toEventString()
{