How to make <input type=“file” /> editable?

2019-06-17 07:37发布

I have found some examples that explains how to make input type=file to be non editable. like <input type="file" onkeydown="blur()" />

But I made test application in Visual Studio and find out that <input type="file" /> in non editable by default.

How to make it editable?

thanks

标签: html file input
2条回答
Juvenile、少年°
2楼-- · 2019-06-17 08:16

The behavior of <input type="file"> elements is very strictly controlled by browsers, and you cannot force them to do anything other than what they want to do. Generally, modern browsers will only allow a file picker to be used for selecting a file for upload. Your Javascript code can't set the value and can't see anything more than the tail file name (the name without prefixing directory names).

查看更多
地球回转人心会变
3楼-- · 2019-06-17 08:16

The following jquery plugin can help in making a intput type="File" editable.

http://www.appelsiini.net/projects/filestyle

查看更多
登录 后发表回答