X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=blobdiff_plain;f=DataObjects%2FImages.php;h=98a6f8159abad63d32f73ea99fe83d382eec2a07;hp=f232d3c6c32c914307217ab00cca4ba7ca064feb;hb=5d4ac076dc4f620fbb91944eead3e0af66216a03;hpb=09f5dff7709824d634e4dd92295f09b3df9bc805 diff --git a/DataObjects/Images.php b/DataObjects/Images.php index f232d3c6..98a6f815 100644 --- a/DataObjects/Images.php +++ b/DataObjects/Images.php @@ -2,7 +2,7 @@ /** * Table Definition for Images */ -require_once 'DB/DataObject.php'; +class_exists('DB_DataObject') ? '' : require_once 'DB/DataObject.php'; class Pman_Core_DataObjects_Images extends DB_DataObject { @@ -271,7 +271,17 @@ class Pman_Core_DataObjects_Images extends DB_DataObject empty($_FILES['imageUpload']['name']) || empty($_FILES['imageUpload']['type']) ) { - $this->err = "Missing file details : Error=". empty($_FILES['imageUpload']['error']) ? '?': $_FILES['imageUpload']['error']; + + $emap = array( + 0=>"There is no error, the file uploaded with success", + 1=>"The uploaded file exceeds the upload_max_filesize directive in php.ini", + 2=>"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form" , + 3=>"The uploaded file was only partially uploaded", + 4=>"No file was uploaded", + 6=>"Missing a temporary folder" + ); + $estr = (empty($_FILES['imageUpload']['error']) ? '?': $emap[$_FILES['imageUpload']['error']]); + $this->err = "Missing file details : Error=". $estr; return false; } @@ -616,7 +626,7 @@ class Pman_Core_DataObjects_Images extends DB_DataObject // 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());