Get file name from input type file Angular2

后端 未结 6 1206
既然无缘
既然无缘 2021-02-19 08:33

I want get the file name from my html input tag in a modal view and save it using Angular2. Can someone help me?

6条回答
  •  无人及你
    2021-02-19 08:52

    HTML

    
        {{ imgFileInput?.files[0]?.name }}
    
    

    Component

    uploadSingle(event) {
      const fileName = event.target.files[0].name;
    }
    

提交回复
热议问题