On 30 Nov, 18:35, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
> Check the encoding on the form, it must be "multipart/form-data".
>
> <?php echo $form->create('Model', array('type' => 'file')); ?>
>
> also check what is in
>
> <?php pr($_FILES); ?>
>
> 2007/11/30, Christopher E. Franklin, Sr. <[EMAIL PROTECTED]>:
>
>
>
> > Well, I guess my first question would be, are you using a browse
> > control to browse for the image on your comp or is it already on the
> > hard drive of the server some where?
>
> > Second, can you post the upload function as well?
>
> > On Nov 30, 8:34 am, Dilbert <[EMAIL PROTECTED]> wrote:
> > > I have an article model with an image field(I don't want to create
> > > another model).
> > > This is the code for admin_add
>
> > > function admin_add() {
> > > if (!empty($this->data)) {
> > > $this->cleanUpFields();
> > > $this->Article->create();
> > > if ($this->Article->save($this->data)) {
> > > if (!empty($this->data['Article']['image']))
> > > {
> > > $fileup=$this->data['Article']['image'];
> > >
> > > $this->Upload->upload('$fileup','../webroot/img/
> > > uploads/');
> > > }
> > > $this->Session->setFlash('Article
> > > saved');
> > > $this->redirect(array('action'=>'index'), null, true); */
>
> > > } else {
> > > $this->Session->setFlash('Article not
> > > saved');
> > > }
> > > }
> > > }
>
> > > The folder uploads is 777.
> > > Where is the problem?
> > > Thank you.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---