$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 [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
-~----------~----~----~----~------~----~------~--~---

Reply via email to