I use following code:
in edit_announce.thtml
<?php echo
$html->formTag('/news/edit_announce','post',array('enctype'=>'multipart/form-data'));
?>
....
....
<?php echo $html->file('picFile',array('style'=>'width:460px;')) ?>
</form>
in news_controller.php
$form = $this->params["form"]["picFile"];
$imgpath = WWW_ROOT."img".DS;
$upFile = $imgpath . 'announce' . DS . $file['name'];
if (move_uploaded_file($file['tmp_name'],$imgpath . $folder . DS .
$file['name']))
{
//Ok!
}
else
{
//errors!
}
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---