sheraz Posted April 14, 2009 Share Posted April 14, 2009 i have allowed full control to all groups but still the problem is Warning: copy(C:\Inetpub) [function.copy]: failed to open stream: Permission denied in C:\Inetpub\wwwroot\crd.php on line 12 please do something ??? ??? ??? ??? [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/154070-rename-copy-delete-files/ Share on other sites More sharing options...
rhodesa Posted April 14, 2009 Share Posted April 14, 2009 what is the PHP script? by the looks of it, the script is trying to copy c:\Inetpub which is a folder Link to comment https://forums.phpfreaks.com/topic/154070-rename-copy-delete-files/#findComment-809901 Share on other sites More sharing options...
sheraz Posted April 15, 2009 Author Share Posted April 15, 2009 the script is to copy a file named output.txt from wwroot directory to the c:/inetpub directory. is it possible that u send me a code of coping a file from 1 directory to other directory. :-\ :-\ Link to comment https://forums.phpfreaks.com/topic/154070-rename-copy-delete-files/#findComment-810496 Share on other sites More sharing options...
gevans Posted April 15, 2009 Share Posted April 15, 2009 <?php $file = 'example.txt'; $newfile = 'example.txt.bak'; if (!copy($file, $newfile)) { echo "failed to copy $file...\n"; } ?> Straight from php.net With directories... <?php $file = 'original/dir/example.txt'; $newfile = 'new/dir/example.txt.bak'; if (!copy($file, $newfile)) { echo "failed to copy $file...\n"; } ?> We can't help you surther unless you post your code Link to comment https://forums.phpfreaks.com/topic/154070-rename-copy-delete-files/#findComment-810719 Share on other sites More sharing options...
DarkSuperHero Posted April 15, 2009 Share Posted April 15, 2009 try changing the permission of the directory your moving files into to 777. If your on a linux machine... Link to comment https://forums.phpfreaks.com/topic/154070-rename-copy-delete-files/#findComment-810724 Share on other sites More sharing options...
gevans Posted April 15, 2009 Share Posted April 15, 2009 try changing the permission of the directory your moving files into to 777. If your on a linux machine... He seems to be working off a C:\ drive on a windows machine so permissions shouldn't be a problem (though it will be in a live environment) Link to comment https://forums.phpfreaks.com/topic/154070-rename-copy-delete-files/#findComment-810728 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.