English 中文(简体)
• 如何从小载荷行为到印刷
原标题:how to get file size from meioupload behavior to print it

i 使用超载荷上载文件,但想节省每台自动上载文件的数量,即如何使用超载处理仪,以便上载文件尺寸。

模型/下载荷.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>
最佳回答

页: 1

Did you try doing that? Then you can use the NumberHelper->toReadableSize() to turn that number into an easier to read number (in KB, MB, GB, TB for example).

问题回答

暂无回答




相关问题
PHP Framework: Ebay Like Site

I am going to be builiding a site like ebay - with all the features of ebay. Please note my payment method is limited to paypal. What would be the best PHP framework to use to build this quickly, ...

specifying date format when using $form->inputs() in CakePHP

I am wondering if there is a way to specify the date format in the forms created using CakePHP s $form->inputs(); Please note that this is not the individual $form->input() but instead $form->inputs() ...

Using DISTINCT in a CakePHP find function

I am writing a CakePHP 1.2 app. I have a list of people that I want the user to be able to filter on different fields. For each filterable field, I have a drop down list. Choose the filter ...

Assistance with CakePHP model relationships

How would I represent the following in a CakePHP model? Product ======= product_id .... Cart ==== cart_id .... Carts_Products ============== cart_id product_id quantity

Prevent controller from trying to autoload model

I am a beginning Cake user and trying to do some work on an already existing application. Running into a problem when I create a new controller. I have created StoreController and when I try to call ...

热门标签