gpt4 book ai didi

php - 当网站托管在centos vmware中时,无法获取$_FILE ["name"] ["tmp_name"]

转载 作者:太空宇宙 更新时间:2023-11-04 04:03:16 26 4
gpt4 key购买 nike

我使用 centos os 构建了一个 Web 服务器,并上传了 joomla 源代码。 网站运行良好!但是当我上传文件时,有些文件我可以获取$_FILE["name"]["tmp_name"],有些文件我无法获取$_FILE["name"]["tmp_name"] 我不知道原因。 经验:

$attachment = $_FILES['upload'];
echo "<pre>";
print_r($attachment);

输出:在 centos 操作系统上:

    Array
(
[name] => Array
(
[0] => myfile.zip
[1] =>
[2] =>
[3] =>
[4] =>
[5] =>
)

[type] => Array
(
[0] => //cannot get
[1] =>
[2] =>
[3] =>
[4] =>
[5] =>
)

[tmp_name] => Array
(
[0] => //cannot get
[1] =>
[2] =>
[3] =>
[4] =>
[5] =>
)
}

在窗口上:

    Array
(
[name] => Array
(
[0] => myfile.zip
[1] =>
[2] =>
[3] =>
[4] =>
[5] =>
)

[type] => Array
(
[0] => application/octet-stream
[1] =>
[2] =>
[3] =>
[4] =>
[5] =>
)

[tmp_name] => Array
(
[0] => C:\wamp\tmp\phpC2D7.tmp
[1] =>
[2] =>
[3] =>
[4] =>
[5] =>
)
}

感谢您的观看!

最佳答案

检查 php.ini 以确保您有该文件的临时路径。

upload_tmp_dir = [something or commented out to accept a server default]

关于php - 当网站托管在centos vmware中时,无法获取$_FILE ["name"] ["tmp_name"],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22264672/

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