Uncaught TypeError: Failed to execute 'readAsDataURL' on 'FileReader': parameter 1 is not of type 'Blob'

前端 未结 4 2239
名媛妹妹
名媛妹妹 2021-02-02 08:18

I\'ve got a problem with a javascript Filereader which returns the error Uncaught TypeError: Failed to execute \'readAsDataURL\' on \'FileReader\': parameter 1 is not of type \'

4条回答
  •  佛祖请我去吃肉
    2021-02-02 08:40

    You need to make sure file has a value (not undefined or null).

    At the top of imageFunction:

    if(!file) {
        // handle error condition and return
    }
    

提交回复
热议问题