0 down vote favorite
share [fb] share [tw]

i use meioupload to upload files..but i want to save size for
everyfile i uploaded..so how to use meioupload to get uploaded file
size..and if it not support this option..are there anyway to do that..

models/download.php

<?php
class Download extends AppModel {
    var $name = 'Download';

var $actsAs = array(
'MeioUpload' => array(
'file_name' => array(
'dir' => 'files',
'create_directory' => false,
'allowedMime' => array('application/pdf', 'application/
msword', 'application/vnd.ms-powerpoint', 'application/vnd.ms-excel',
'application/rtf', 'application/zip'),
'allowedExt' => array('.pdf', '.doc', '.ppt', '.xls',
'.rtf', '.zip'),
'default' => false,
)
)
);

to upload new file downloads/add.ctp

<div class="files form">
<?php echo $form->create('Download',array('type' => 'file')); ?>
    <fieldset>
        <legend><?php __('Add FIle'); ?></legend>
    <?php

echo $this->Form->input('title');
echo $form->input('file_name', array('type' => 'file'));
$options =
array('d'=>'Document','P'=>'Pdf','A'=>'Audio','C'=>'Compressed','o'=>'Other');
echo $form->select('type',$options,'f',array('empty'=>false));

    ?>
    </fieldset>
<?php echo $this->Form->end(__('Submit', true));?>
</div>
<div class="actions">
    <h3><?php __('Actions'); ?></h3>
    <ul>

        <li><?php echo $this->Html->link(__('List Files', true),
array('action' => 'index'));?></li>
        <li><?php echo $this->Html->link(__('Add File', true),
array('action' => 'add')); ?> </li>
    </ul>
</div>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to