I want to copy a file which is in a folder and copy to pub/media/product folder for product image... my current file directory pub/media/xyz/images/i/j/ijk.jpeg . i want this image to product folder. how to get that using php?
2 Answers
use below ssh command to copy file to other folder
cp pub/media/xyz/images/i/j/ijk.jpeg pub/media/product
$file = 'example.txt';
$newfile = 'example.txt.bak';
copy($file, $newfile)