gpt4 book ai didi

php - 上传 Magento 包时 $_FILES 为空

转载 作者:行者123 更新时间:2023-12-02 11:16:15 24 4
gpt4 key购买 nike

我正在尝试安装 Magento 软件包,但我得到No file was uploaded

它来自此代码,因为 $_FILES/downloader/Mged/Controller.php 中的空数组

/**
* Install uploaded package
*/
public function connectInstallPackageUploadAction()
{
if (!$_FILES) {
echo "No file was uploaded";
return;
}

if(empty($_FILES['file'])) {
echo "No file was uploaded";
return;
}

$info =& $_FILES['file'];

if(0 !== intval($info['error'])) {
echo "File upload problem";
return;
}

$target = $this->_mageDir . DS . "var/" . uniqid() . $info['name'];
$res = move_uploaded_file($info['tmp_name'], $target);
if(false === $res) {
echo "Error moving uploaded file";
return;
}

$this->model('connect', true)->installUploadedPackage($target);
@unlink($target);
}

值得注意的是,产品上传工作正常。

我得到的唯一日志输出是

2014-07-03T18:44:15+00:00 ERR (3): Warning: array_key_exists() expects parameter 2 to be array, null given in /var/www/vhosts/example.com/httpdocs/app/code/core/Mage/Captcha/Model/Observer.php on line 166

Exception.log 为空

最佳答案

确保您的 magento 安装中的 var 文件夹是完全可写的。第777章 许可。所有文件夹和文件。

关于php - 上传 Magento 包时 $_FILES 为空,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24536777/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com