Re: DOFormBuilder :: ImageUpload
| From: | Justin Patrin | Date: | Fri, 05 Nov 2004 18:07:50 +0000 |
| Subject: | Re: DOFormBuilder :: ImageUpload | ||
| References: | 1 2 3 4 5 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-15363@lists.php.net to get a copy of this message | ||
On Fri, 5 Nov 2004 18:58:10 +0100, Alexander Petri <alex.petri@gmx.de> wrote:
> 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);
That would work. You just don't want DO trying to insert a non-existant field.
>
>
>
>
> 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";
>
> }
> }
>
--
paperCrane --Justin Patrin--