Re: DOFormBuilder :: ImageUpload
| From: | Alexander Petri | Date: | Fri, 05 Nov 2004 17:58:10 +0000 |
| Subject: | Re: DOFormBuilder :: ImageUpload | ||
| References: | 1 2 3 4 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-15362@lists.php.net to get a copy of this message | ||
so the function must look like this??
function insert($do = false){
require_once 'DB/DataObject/Cast.php';
$this->news_added = DB_DataObject_Cast::sql('NOW()');
$this->news_updated = DB_DataObject_Cast::sql('NOW()');
// here....
if (isset($this->image_path)) unset($this->image_path);
parent::insert();
if (is_uploaded_file($_FILES['Image_Path']["tmp_name"])) {
if (move_uploaded_file($_FILES['Image_Path']["tmp_name"],
$this->id.".jpg")
&& chmod($this->id.".jpg", 0644)) {
// echo "ok";
}
}