UsagiChan Posted March 4, 2007 Share Posted March 4, 2007 I've tried several ways to copy a file and I simply cannot get it to copy: I have an image in one directory which I wish to copy to another. I wish to do this from a program which appears in the browser. both $current_file and $thumb_name have the entire path and the name of the file. I've tried: if (!copy($current_file, $thumb_name)) { echo "failed to copy $current_file...\n"; } And I've tried this with and without the "sudo" and with and without the -f $cmd = "sudo cp -f " . $current_file . " " . $thumb_name ; $make_magic = system($cmd) ; I've used webmin to make sure all the files are owned by apache and have 755 permissions. The files were uploaded through a browser so they are usually owned by apache. I also tried changing them all to be owned by prosenpoetry which is the owner of the webite folders. So far all I get is "failed to copy..." when using the first copy and simply ignored when I try the second.. After having tried to do this simple copy for many hours I am totally frustrated. Any ideas? Thanks, Usagi Link to comment https://forums.phpfreaks.com/topic/41060-copy-files/ Share on other sites More sharing options...
ashly Posted March 4, 2007 Share Posted March 4, 2007 Are you trying to delete the file from the source folder after copying? How do you want to copy the file.. copy to another location or move to another location? Link to comment https://forums.phpfreaks.com/topic/41060-copy-files/#findComment-198976 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.