为输入文件表单设置默认值 [英] Set default value for a input file form

查看:117
本文介绍了为输入文件表单设置默认值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能存在重复:

动态设置文件输入的值

我有一个输入文件的HTML表单,我想在HTML表单中设置文件路径的初始值。我试图改变标签的价值,但它无论如何不起作用。
< input type =filename =testcasevalue =C:\test.txt>

I have an input file HTML form and I want to set the initial value for the file path in an HTML form . I try to change tag "value" but it doesn't work anyway. <input type="file" name="testcase" value= "C:\test.txt">

请给我一些关于这个小问题的建议。感谢。

Please give me some advice for this small problem. Thanks.

推荐答案

From HTMLHelp.com

From HTMLHelp.com :


文件输入类型创建一个字段
,通过它用户可以从本地计算机或网络上传文件

VALUE属性指定了初始文件的名称
,但它通常被浏览器忽略为
,作为
安全预防措施。

The file input type creates a field through which users can upload files from their local computer or network. The VALUE attribute specifies the name of the initial file, but it is typically ignored by browsers as a security precaution.

因此,不支持设置初始值。

Therefore, setting an initial value is not supported.

这篇关于为输入文件表单设置默认值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆