原文:Uncaught DOMException: Failed to set the 'value' property on 'HTMLInputElement': This input element accepts a filename, which may only be programmatically set to the empty string.

今天上傳圖片遇到這個報錯 百度了下,網上說是input標簽type file所以導致的問題,可是我的type hidden 解決辦法: 把上面的代碼改成如下問題就解決了 ...

2018-09-27 16:04 0 3883 推薦指數:

查看詳情

TypeError: Failed to set the 'files' property on 'HTMLInputElement': The provided value is not of type 'FileList'.

這個標題也是很low了,但是想着大家遇到這個錯之后,肯定都想這樣直接搜索就找到答案。其實大家應該是和我一樣,就是想將type="file"類型的控件置空,或者說reset。如果只是單純的將value置空,那么雖然沒有文件名了,但是files屬性值依然在,我在網上搜了不少,終於找到了答案 ...

Fri Jan 03 23:26:00 CST 2020 4 1622
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM