使用copy()和rename()的问题 [英] problems using copy() and rename()

查看:55
本文介绍了使用copy()和rename()的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图移动文件但运气好

我的代码如下。临时路径和目标路径有效,因为它们正确地回显了

。但我无法使copy()函数工作,或者重命名()

函数


$ temp_path = $ tempdir。 basename($ uploadedfile [" name"] [$ x]);


echo" Target - "。$ target_path。" Temp - "。$ temp_path。"< br>" ;;


copy($ temp_path,$ target_path);


有没有人遇到过这个问题?


Ian

解决方案

target_path =

targetdir。基名(

UploadedFile的["名称"]

Im trying to move a file but am having luck
my code is below. The temp and target paths are valid as they echo
correctly. but I cant get the copy() function to work, or the rename()
function

$target_path = $targetdir . basename($uploadedfile["name"][$x]);
$temp_path = $tempdir. basename($uploadedfile["name"][$x]);

echo "Target - ".$target_path." Temp - ".$temp_path."<br>";

copy($temp_path, $target_path);

has any one experienced this problem?

Ian

解决方案

target_path =


targetdir . basename(


uploadedfile["name"]


这篇关于使用copy()和rename()的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆