Answers for "php copy image from one folder to another"

PHP
1

php copy image from one folder to another

<?php
$imagePath = "/var/www/projectName/Images/somepic.jpg";
$newPath = "/test/Uploads/";
$ext = '.jpg';
$newName  = $newPath."a".$ext;

$copied = copy($imagePath , $newName);

if ((!$copied)) 
{
    echo "Error : Not Copied";
}
else
{ 
    echo "Copied Successful";
}
?>
Posted by: Guest on March-31-2022

Code answers related to "php copy image from one folder to another"

Browse Popular Code Answers by Language