Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Copy file from one directory to another Laravel

//Copy image using file facade laravel
$url = $data['featured_image'];
$imageName = substr($url, strrpos($url, '/') + 1);
$selected_file = str_replace(URL::to('/'),'',$url);
File::copy(public_path().'/'.$selected_file, public_path().'/storage/images/pages/'.$imageName.'');
 
PREVIOUS NEXT
Tagged: #Copy #file #directory #Laravel
ADD COMMENT
Topic
Name
8+8 =