有人可以请你解释一下当你调用函数setDestination()时到底发生了什么?根据Zend"文档",这些都应该有效,但只有第一种情况才将文件放在我想要的位置.第二个只是在/ tmp中抛弃它
情况1:
$file = new Zend_Form_Element_File('fileupload');
$file->setDestination('/some/pathsomewhere/');
Run Code Online (Sandbox Code Playgroud)
这样工作正常,文件将上传到/ some/pathsomewhere
案例2 :(在检查isValid($ _ POST)之后)
$upload = new Zend_File_Transfer_Adapter_Http();
$upload->setDestination('/some/pathsomewhere/');
try {
$upload->receive();
}
Run Code Online (Sandbox Code Playgroud)
没有例外.文件被丢弃在/ tmp中
我不明白为什么文件在案例2中的/ tmp结束:(