相关资料:__________________________________________________________
int copy(string source, string dest);———————————————————————————————
source,源文件 dest,目标文件
———————————————————————————————
<?
if (!copy($file, $file.'.bak')) {
print("复制文件 $file 失败...<br>\n");
}
?> ———————————————————————————————
你的格式写对了吗?
int copy(string source, string dest);———————————————————————————————
source,源文件 dest,目标文件
———————————————————————————————
<?
if (!copy($file, $file.'.bak')) {
print("复制文件 $file 失败...<br>\n");
}
?> ———————————————————————————————
你的格式写对了吗?
copy($img,"e:/web/",$img_name);//写入数据
$img是数据流,$img_name是新名称,没问题吧
估计有二个问题,
1.$img 应该是源文件的路径和名称
2.目的文件写法错了 "e:/web/".$img_name<?php
$img_name = "ttt.txt";
copy("test.txt","./".$img_name);//
?>
$to_img="e:/web/".$img_name;
copy($from_img,$to_img);
顺便问一下:
1。copy($img,$path_name);中的$path_name可用"/images/1.jpg"吗?还是必须把绝对路径(即盘符)也写出来?
2。$img是上传文件时表单中的<input type='file' name='img'>那$img是什么流?还是别的什么?