我正在尝试移动使用 move_uploaded_file 上传的文件。这是我的变量:
$filename = $_FILES['File_file']['name'];
$folder_id = $_POST['File']['folder_id'];
$folder_name_result = $this->filemanager_model->getfoldername($folder_id);
$fileloc = $_FILES['File_file']['tmp_name'];
$folder_name = "";
foreach ($folder_name_result->result_array() as $row)
{$folder_name = $row['title'];}
$pathAndName = "filemanager/".$folder_name."/".$filename;
以及变量的输出:
$文件夹名称=Grrr
$pathAndName =filemanager/Grrr/cis.png
$fileloc =C:\xampp1.8\tmp\phpE21E.tmp
当我运行 move_uploaded_file 函数时,它会生成一个错误,其中:
move_uploaded_file(filemanager/Grrr/cis.png): failed to open stream: No such file or directory
move_uploaded_file(): Unable to move 'C:\xampp1.8\tmp\php2565.tmp' to 'filemanager/Grrr/cis.png'
我的文件路径:
/admin
- base_url
/admin/filemanager/Grr
- 我要保存的文件夹
/admin/application/controllers/
- 我的控制器的路径
我的代码是否有问题,为什么它不起作用?