php 함수를 이용하여 파일을 이동할려고 합니다.
본문
rename('../../폴더/$파일변수', '../../폴더2/$파일변수'); // rename('기존에 있는 파일','옮기려고 하는 파일')
이렇게 하는게 아닌가요? ㅠ,ㅠ
파일권한도 777로 바꿔는데... 이렇게 간단하지 않나요...ㅠㅠ
이것도 안되서
$tmp_file = "'../../폴더/$파일변수";
$file_path = "'../../폴더1/$파일변수";
copy($tmp_file, $file_path);
//unlink("삭제할 파일");
unlink("../../폴더/$파일변수");
이것도 안되네요 ㅠ,ㅠ
!-->!-->
답변 2
http://php.net/manual/en/function.copy.php
<?php
$file = 'example.txt';$newfile = 'example.txt.bak';
if (!copy($file, $newfile)) {
echo "failed to copy $file...\n";
}
?>
http://php.net/manual/en/function.unlink.php
보고 참고해보시길 바랍니다 .. ^_^
폴더1 <--- 이 폴더가 없다면 생성부터 먼저 해주어야겠죠
답변을 작성하시기 전에 로그인 해주세요.