|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Copy folder into another
Hi all !
I want to copy folder into another. I am working on red hat linux . The code I have written is : $source_file = /var/www/html/SAS/template/1/1/template.jpg"; $destination_file = "/var/www/html/Accountant/"; if (is_dir($destination_file)) { echo "Dest file exists"; copy($source_file, $destination_file); } But Its giving error: Unable to create '/var/www/html/Accountant/': Is a directory in /var/www/html/SAS/selectedtemplate.php on line 22 I have given permissions 777 to all the folders i.e.var,www,html,accountant,SAS Could anyone help me out. Thanks in advance |
|
#2
|
|||
|
|||
|
Your $destination_file variable contains a directory but not a file name afterwards. Try adding a filename on the end and see if thats works.
I presume you've done it this way since under linux you don't need to specify the target filename if it is the same as the source filename but I think with the php copy function you do. Hope this helps, -KM- |
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > Copy folder into another |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|