0
다음 젠드 프레임 워크 양식을 작동하지 않는 : 나는 양식이 제대로 작동 코드에서이 줄을 제거하면Zend_Form_Element_File가 제대로 작동하지 않습니다
->setDestination('/data/uploads')
:
<?php
class Application_Form_Auth extends Zend_Form
{
public function init()
{
$this->setAttrib('enctype', 'multipart/form-data');
$this->setMethod('post');
$username = $this->createElement('text','username');
$username->setLabel('Username:')
->setAttrib('size',10);
$password = $this->createElement('password','password');
$password->setLabel('Password')
->setAttrib('size',10);
$file = new Zend_Form_Element_File('file');
$file->setLabel('File')
->setDestination('/data/uploads')
->setRequired(true);
$reg = $this->createElement('submit','submit');
$reg->setLabel('save');
$this->addElements(array(
$username,
$password,
$file,
$reg
));
return $this;
}
}
?>
문제에 있습니다. /data/uploads
에 업로드 폴더가 있고 디렉토리에 777
으로 설정된 권한이 있습니다. 이 문제를 어떻게 해결할 수 있습니까? 감사합니다
'data' 폴더가 실제로 서버의 루트에 있거나 응용 프로그램 디렉토리에 있습니까? 경로를 잘못 지정했다고 생각합니다. 'APPLICATION_PATH를 시도하십시오. '/ data/uploads'를 대신 사용하십시오. – drew010