【发布时间】:2011-03-07 11:00:44
【问题描述】:
我在 Windows 7 上运行 Zend Server CE。默认情况下,我将 Apache 作为服务运行,以本地系统帐户登录。
我的上传操作将上传的文件保存到其目标 OK,但是文件的权限设置为仅 SYSTEM、Administrators 和 IIS_IUSERS。
上传后,我无法使用 PHP 打开或移动它。我正在使用以下代码在 POST 上接收 Zend Framework 中的文件:
$upload = new Zend_File_Transfer_Adapter_Http();
$upload->setDestination($_SERVER['DOCUMENT_ROOT']. "/".$upFolder);
if (!$upload->isValid()) {
$messages = $upload->getMessages();
throw new Exception( implode("\n", $messages));
}else{
try {
$upload->receive();
}
catch (Zend_File_Transfer_Exception $e)
{
throw new Exception('Bad file: '.$e->getMessage());
}
如何设置权限,以便在 php/zend 中使用上传的文件
【问题讨论】:
-
你得到什么错误信息?
-
我实际上可以移动它,但是我无法打开文件。它是一个 csv 文件。当我右键单击-> 属性-> 安全时,它说“要继续,您必须是有权查看此对象的安全属性的管理用户”我实际上想要做的是在这个文件上从 php 调用一个过程,见上文.
-
您解决了吗?对我来说听起来像 UAC,只需关闭该功能 ...
标签: php zend-framework file-upload file-permissions