File Zend framework上载文件和设置目标问题

File Zend framework上载文件和设置目标问题,file,zend-framework,upload,path,File,Zend Framework,Upload,Path,我在用ZF上传文件时遇到问题。 这是我的应用程序结构: //application //images index.php //library //styles //public //img index.php中的应用程序路径似乎正常: defined('APPLICATION_PATH') || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/application')); 当我试图上传一个文件时,我会收到一

我在用ZF上传文件时遇到问题。 这是我的应用程序结构:

//application
//images
index.php
//library
//styles
//public
  //img
index.php中的应用程序路径似乎正常:

defined('APPLICATION_PATH')  
    || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/application'));
当我试图上传一个文件时,我会收到一条消息(这样的目录不存在)

这是我的控制器代码段:

$upload->setDestination(APPLICATION_PATH . '../public/img/');

有人能帮忙吗?

您的应用程序路径后面没有斜杠。按如下方式调用setDestination():

$upload->setDestination(APPLICATION_PATH . '/../public/img/');

没错。现在一切都好了。非常感谢你的帮助。