function onUploadFromData($filename, $data, $roo)
{
-// echo $_FILES['imageUpload']['type'];exit;
- if (empty($_FILES['imageUpload']['tmp_name']) ||
- empty($_FILES['imageUpload']['name']) ||
- empty($_FILES['imageUpload']['type'])
- ) {
+ if (empty($filename) || empty($data)) {
$this->err = "Missing file details";
return false;
}
if ($this->id) {
$this->beforeDelete();
}
- if ( empty($this->ontable)) {
+
+ if (empty($this->ontable)) {
$this->err = "Missing ontable";
return false;
}
if (!empty($this->imgtype) && $this->imgtype[0] == '-' && !empty($this->onid)) {
- // then its an upload
$img = DB_DataObject::factory('Images');
$img->onid = $this->onid;
$img->ontable = $this->ontable;
$img->beforeDelete();
$img->delete();
}
-
}
+ preg_match('/^data:([.]*);/', $data, $matches);
+ print_r($matches);exit;
require_once 'File/MimeType.php';
$y = new File_MimeType();