我有一个表格,我可以从中上传一些文件。文件数组显示正确print,但目标文件夹中没有文件。我错过了什么?
这是我的代码:
// Fileupload
if (!is_dir('../incidentbijlagen/'.$inc['incident']['companyname'].'')) {
mkdir('../incidentbijlagen/'.$inc['incident']['companyname'].'', 0777, true);
}
$uploads_dir = '../incidentbijlagen/'.$inc['incident']['companyname'].'/';
foreach($bijlage['incident'] as $key => $file){
$tmp_name = $file['incident']['tmp_name']['bijlage'][$key];
$name = basename($file['incident']['name']['bijlage'][$key]);
move_uploaded_file($tmp_name, "$uploads_dir/$name");
}
我的 error_log 中没有错误,所以我不确定为什么文件没有被移动。这是我的阵列在我print它时的样子:
Array
(
[incident] => Array
(
[name] => Array
(
[bijlage] => Array
(
[0] => fblogosnm.jpg
)
)
[type] => Array
(
[bijlage] => Array
(
[0] => image/jpeg
)
)
[tmp_name] => Array
(
[bijlage] => Array
(
[0] => /tmp/phpnh5aHW
)
)
[error] => Array
(
[bijlage] => Array
(
[0] => 0
)
)
[size] => Array
(
[bijlage] => Array
(
[0] => 20573
)
)
)
)
慕桂英546537
HUX布斯