upload framework extension .swf php
i want to upload a .swf format and i am getting an exception "false extension" and i tried to put a validator on the extension and it still didn't work any ideas how to upload .swf and do i need a special uploader. This is my form code.
class Admin_Form_Banner extends ZendX_Form_Designed {
pu开发者_运维百科blic function init() {
$this->setEnctype(self::ENCTYPE_MULTIPART);
$this->setMethod(self::METHOD_POST);
$this->setMethod('post');
// Add an email element
$this->addElement('text', 'banner_title', array(
'label' => 'Banner Title',
'required' => true,
"class" => 'required',
'filters' => array('StringTrim')
));
$this->addElement('select','banner_type',array(
'label'=>'type',
'required'=>TRUE,
'class'=>'required',
'multiOptions'=>array('1'=>'Image','2'=>'Flash','3'=>'HTML')
));
$this->addElement('text', 'banner_link', array(
'label' => 'Banner Link',
'required' => true,
"class" => 'required url',
'value'=>'http://www.',
'filters' => array('StringTrim'),
));
$this->addElement('select','link_open',array(
'label'=>'choose how do you want the link to open ?',
'required'=>TRUE,
'multiOptions'=>array('self'=>'Same Page','_new'=>'Tab Page')
));
$this->addElement('checkbox', 'is_active', array(
'label' => 'Is Active',
'required' => true,
"class" => 'required',
'filters' => array('StringTrim')
));
$banner_position = new Zend_Form_Element_Select('banner_position');
$banner_position->setMultiOptions($this->getBannerPositions())->setLabel('Banner Position');
$this->addElement($banner_position, 'banner_position');
$this->addElement('hidden', 'file_path', array(
'required' => true,
"class" => 'required',
'Extension'=>'.swf'
));
$this->addElement('submit', 'submit', array(
'ignore' => true,
'label' => ''
));
}
Well it's a Zend_Form_Element_Hidden how could you receive a fileupload from that element ? Maybe you've made some customization to allow that but we can't really guess with this limited code sample.
精彩评论