Hi,
I too had a similar problem but when I  try to put the
$form->create('User',   array('action'  =>      'upload',
'type=>'file'));

I get this error, which doesn't happen when I remove the
'type'=>'file' option.. but then the file actually doesn't upload even
though the record gets added to the database.. any idea whats wrong
---------------------------------
Notice (8): Array to string conversion [CORE\cake\libs\model
\datasources\dbo_source.php, line 505]
Query: INSERT INTO `resumedetails`
(`resume_id`,`resume_content`,`pic`) VALUES (2,'sdfsdf',Array)
Warning (512): SQL Error: 1054: Unknown column 'Array' in 'field
list' [CORE\cake\libs\model\datasources\dbo_source.php, line 440]
------------------------------------------------------
Its trying to pass Array instead of the actual file name

Thanks in advance



On Oct 18, 9:05 pm, "Samuel DeVore" <[EMAIL PROTECTED]> wrote:
> $form->create('User',   array('action'  =>      'upload', 'type=>'file'));
>
> this should make your form mime/multipart which is needed for upload
>
> Sam D
> On 10/18/07, Rex <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > Hi,
>
> > I am trying to handle a file upload in cakephp 1.2
> > Problem is that the uploaded file information is not available in the
> > controller.
> > In the controller, $this->params['form'] is empty.
> > Please help me debug this.
>
> > TIA,
> > Rex
>
> > //==================    View    ========================
> > <?php
> > echo    $form->create('User',   array('action'  =>      'upload'));
> > echo    $form->label('Users.fileUpload','Upload User    Database
> > File',null);
> > echo    $form->file('File');
> > echo    $form->submit('Upload');
> > echo    $form->end();
> > ?>
>
> > //==================    Controller      ====================
> > <?php
> > class   UsersController extends AppController
> > {
> > var     $name   = 'Users';
> > var     $helpers = array('Html', 'Form');
>
> > function upload()
> > {
> >         var_dump($this->params['form']); print  '<br/>';
>
> > }
> > ?>
>
> --
> (the old fart) the advice is free, the lack of crankiness will cost you
>
> - its a fine line between a real question and an idiot
>
> http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to