上传框架扩展名.swf php
我想上传一个.swf格式,我得到了一个异常“假扩展名”,我试图在扩展名上设置一个验证程序,但它仍然没有任何想法如何上传.swf,我是否需要一个特殊的上传程序。这是我的表格代码 类管理员表单横幅扩展了ZendX表单{上传框架扩展名.swf php,php,zend-framework,upload,flash,Php,Zend Framework,Upload,Flash,我想上传一个.swf格式,我得到了一个异常“假扩展名”,我试图在扩展名上设置一个验证程序,但它仍然没有任何想法如何上传.swf,我是否需要一个特殊的上传程序。这是我的表格代码 类管理员表单横幅扩展了ZendX表单{ public function init() { $this->setEnctype(self::ENCTYPE_MULTIPART); $this->setMethod(self::METHOD_POST); $this->setMetho
public 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' => ''
));
}
这是一个Zend_Form_元素,隐藏了你怎么能从该元素接收文件上传?
也许您已经进行了一些定制,以允许这样做,但我们无法用这个有限的代码示例进行真正的猜测。从未见过“ZendX\u Form\u Design”?这是什么类。我在你的源代码中找不到文件元素,你能提供更多信息吗?ZendX_Form_是为zend_Form设计的扩展,所以它就像处理zend Form一样。你是对的,反正有太多自定义项,我将其更改为普通文件上载谢谢