Jump to content

Copy files


UsagiChan

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.