{
// copy the file into the storage area..
if (!file_exists($file) || !filesize($file)) {
+ $this->err = "File $file did not exist or is 0 size";
return false;
}
empty($_FILES['imageUpload']['name']) ||
empty($_FILES['imageUpload']['type'])
) {
- $this->err = "Missing file details";
+ $this->err = "Missing file details : Error=". (empty($_FILES['imageUpload']['error']) ? '?': $_FILES['imageUpload']['error']);
return false;
}
if (!$this->createFrom($_FILES['imageUpload']['tmp_name'])) {
+ $this->err = isset($this->err) ? $this->err : "createFrom Image failed";
return false;
}
return true;
}
- function toRooArray($req = array()) {
- // echo '<PRE>';print_r($req);exit;
+ function toRooArray($req) {
+
$ret= $this->toArray();
static $ff = false;
// print_r(!$this->onUpload($this));
if ( !$this->onUpload($this)) {
- $roo->jerr("File upload failed : ". (!empty($this->err) ? $this->err : ''));
+ $roo->jerr("File upload failed : error = ". (!empty($this->err) ? $this->err : ''));
}
$roo->addEvent("ADD", $this, $this->toEventString());
umask($oldumask);
}
- file_put_contents($f, file_get_contents($data));
+ file_put_contents($f, file_get_contents("data://" . $data));
$o = clone($this);