0

CakePHP 2.x on OpenShift PAAS

I am trying to get all the particulars about a file

  • name
  • type
  • temp name

Some Results:

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

and ..

print_r($this->request->params);
Array ( [plugin] => [controller] => products [action] => import [named] => Array ( ) [pass] => Array ( ) )

I have the following in the ProductsController:

public function import()    {
    //print_r($this->request);
    print_r($this->data);
}

I have the following in 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(); ?>

1 Answer 1

1
<?php echo $this->Form->create('Import',
        array(
            'class' => 'form-horizontal',
            'style' => false,
            'url' => array ('controller' => 'products', 'action' => 'import'),
            'type'=>'file'
            )); ?>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.