原文: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