get file name without extension in laravel?

前端 未结 13 917
温柔的废话
温柔的废话 2021-02-05 01:14

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

13条回答
  •  无人及你
    2021-02-05 01:49

    here you need to call php PATHINFO_FILENAME

    $file = $request->file('fileupload')->getClientOriginalName();
    $fileName = pathinfo($file,PATHINFO_FILENAME);
    dd($fileName);
    

提交回复
热议问题