请问高手,怎样给一个type为FILE的input域赋值

lancky 2003-10-18 06:54:56
我想通过别的方式给

<form name="form1">
<input type="file" name="file1">
</form>
赋值,直接用form1.file1.value="kkk" 不行,
请问是调用什么属性可以实现,谢谢高手!
...全文
87 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
超级大笨狼 2003-11-24
  • 打赏
  • 举报
回复
For a file upload to take place:

The file element must be enclosed within a FORM element.
A value must be specified for the NAME attribute of the file element.
The METHOD attribute of the FORM element must be set to post.
The ENCTYPE attribute of the FORM element must be set to multipart/form-data.
To handle a file upload to the server, a server-side process must be running that can handle multipart/form-data submissions. For example, the microsoft posting acceptor allows Microsoft® Internet Information Server to accept file uploads. Additional Common Gateway Interface (CGI) scripts that can handle multipart/form-data submissions are available on the Web.

The file element is an inline element and does not require a closing tag.

Rex_love_Burger 2003-10-19
  • 打赏
  • 举报
回复
这样能不能解决问题?
Struggling 2003-10-19
  • 打赏
  • 举报
回复
<script language=javascript>
function window.onload()
{
file.focus();
var WshShell=new ActiveXObject("WScript.Shell"); //会有安全提示
WshShell.sendKeys("c:\\test.txt"); //向文本框里发送东东
}
</script>
<input name=file type=file>
zhanghuazhanghome 2003-10-18
  • 打赏
  • 举报
回复
关注

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧