Monday 15 August 2011

cakephp 2.x file upload -


CakePHP 2.x on OpenShift PAAS

I try to get all the details about a file

  • Type
  • Temporary names

    Some results:

  • Pre> print_r ($ this-> data); Array ([import] = & gt; array ([file] => PCI_card_KCF_04252013.csv))

    and

      print_r ($ this- & Gt; Request & gt; Parameter); Array () [pass] = & gt; I have the following in the Product Controller:  
      Public function imports () {// print_r ($ this- & gt;) ; request); Print_r ($ this-> data); }   

    I have the following in index.ctp:

      & lt ;? Php echo $ this- & gt; Form- & gt; Create ('import', array ('class' = & gt; 'form-horizontal', 'style' => false, 'url' = & gt; array ('controller' => 'product' 'Action' = & gt; 'import'))); ? & Gt; & Lt; Div class = "control-group" & gt; & Lt ;? Php echo $ this- & gt; Form- & gt; Input ('file', array ('type' = & gt; 'file', 'label' = & gt; wrong, 'div' = & gt; 'control')); ? & Gt; & Lt; / Div & gt; & Lt ;! - End of control group - & gt; & Lt; Div class = "control-group" & gt; & Lt ;? Php echo $ this- & gt; Form- & gt; Submit (_ ('import'), array ('type' = & gt; 'submit', 'class' = & gt; 'btn btn-primary btn-big', 'labels' = & gt; wrong, 'Style' = & gt; false, 'div' = & gt; 'control')); ? & Gt; & Lt; / Div & gt; & Lt ;? Php echo $ this- & gt; Form- & gt; the ending (); ? & Gt;    

      & lt; Php echo $ this- & gt; Form- & gt; ('Controller' = & gt; 'product', 'action' = '& gt; import'), 'type' = & gt; 'File')); ? & Gt;    

  • No comments:

    Post a Comment