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>