get file name without extension in laravel?

前端 未结 13 948
温柔的废话
温柔的废话 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:57

    Get the file name using getClientOriginalName(); then use the explode function to get the name and the image format as shown below:

    $image=Input::file('image'); $fullName=$image->getClientOriginalName(); $name=explode('.',$fullName)[0];

提交回复
热议问题