I have used Input::file(\'upfile\')->getClientOriginalName()
to retrieve name of uploaded file but gives name with extension like qwe.jpg
.How do I g
You can use this code too.
if ($request->hasfile('filename')) {
$image = $request->filename;
$namewithextension = $image->getClientOriginalName(); //Name with extension 'filename.jpg'
$name = explode('.', $namewithextension)[0]; // Filename 'filename'
$extension = $image->getClientOriginalExtension(); //Extension 'jpg'
$uploadname = time() . '.' . $extension;
$image->move(public_path() . '/uploads/', $uploadname);
}