在上传名称中包含空格的图像时会出现错误消息:
An unknown error has occurred.
以下是表格代码:
$resizeRename = new Zend_Form_Element_File('renameResize');
$resizeRename->setDestination('images/fbAppLogo');
$resizeRename->setLabel('Upload App Logo');
$resizeRename->addFilter(new Skoch_Filter_File_Resize(array(
'width' => 111,
'height' => 74,
'keepRatio' => true,
)));
$resizeRename->setAttrib('class','tooltip');
$resizeRename->setAttrib('title','Upload file');
$this->addElement($resizeRename);
here is the code of my controller:-
if ($form->isValid($data)) {
$file=pathinfo($form->renameResize->getFileName());
if($form->renameResize->receive()) {
$this->view->renameResize=pathinfo($form->renameResize->getFileName());
}
}
如果图像名称不包含空格,上面的代码工作正常。