cakephp 2.x文件上载

cakephp 2.x文件上载,cakephp,file-upload,csv,cakephp-2.0,paas,Cakephp,File Upload,Csv,Cakephp 2.0,Paas,OpenShift PAAS上的CakePHP 2.x 我正设法弄到一份档案的所有细节 名字 类型 临时名称 一些结果: print_r($this->data); Array ( [Import] => Array ( [file] => PCI_card_KCF_04252013.csv ) ) 和 print_r($this->request->params); Array ( [plugin] => [controller] => prod

OpenShift PAAS上的CakePHP 2.x

我正设法弄到一份档案的所有细节

  • 名字
  • 类型
  • 临时名称
一些结果:

print_r($this->data);
Array ( [Import] => Array ( [file] => PCI_card_KCF_04252013.csv ) )

print_r($this->request->params);
Array ( [plugin] => [controller] => products [action] => import [named] => Array ( ) [pass] => Array ( ) )
我在ProductsController中有以下内容:

public function import()    {
    //print_r($this->request);
    print_r($this->data);
}
我在index.ctp中有以下内容:

<?php echo $this->Form->create('Import',
        array(
            'class' => 'form-horizontal',
            'style' => false,
            'url' => array ('controller' => 'products', 'action' => 'import')
            )); ?>
        <div class="control-group">
                <?php echo $this->Form->input('file',
                    array(
                    'type' => 'file',
                    'label' => false,
                    'div' => 'controls',
                    )); ?>
        </div><!-- end of control group -->
    <div class="control-group">
            <?php echo $this->Form->submit(_('Import'),
                array(
                'type' => 'submit',
                'class' => 'btn btn-primary btn-large',
                'label' => false,
                'style' => false,
                'div' => 'controls'
                )); ?>
    </div>
<?php echo $this->Form->end(); ?>


<?php echo $this->Form->create('Import',
        array(
            'class' => 'form-horizontal',
            'style' => false,
            'url' => array ('controller' => 'products', 'action' => 'import'),
            'type'=>'file'
            )); ?>