Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel getclientoriginalextension

if ($request->hasFile('photos')) {
$files = $request->file('photos');
foreach($files as $file){
    $filename = $file->getClientOriginalName();
    $extension = $file->getClientOriginalExtension();
    $fileName = str_random(5)."-".date('his')."-".str_random(3).".".$extension;
    $destinationPath = 'images/Foldername'.'/';
    $file->move($destinationPath, $fileName);
}
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #laravel #getclientoriginalextension
ADD COMMENT
Topic
Name
7+5 =