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

使用 HTML 的圖片上傳api的時候報如下錯誤: Uncaught InvalidStateError: Failed to set the value property on HTMLInputElement : This input element accepts a filename, which may only be programmatically set to the empty ...

2016-01-18 19:51 0 3945 推薦指數:

查看詳情

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