input file 标签上传如何实现
本帖最后由 libo1220 于 2014-11-3 10:21 编辑HTML:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
</head>
<body>
<form name="myform" method="post" action="upfile.jsp">
<input type="file" name="upfile" size="36" />
<input type="submit" name="upload" value="上传附件" />
<font color="red"> 文件最大20M,选择文件后,按"上传附件"上传附件</font>
</form>
</body>
</html>
autoit 脚本:#include <IE.au3>
;路径需要改一下C:\Users\linliangbai\Desktop\adf\index.html
$oIE = _IECreate ("C:\Users\linliangbai\Desktop\adf\index.html",0,1,1,0)
WinSetState($oIE.title,"",@SW_MAXIMIZE)
Local $oForm = _IEFormGetObjByName($oIE,"myform");form
Local $oFile=_IEFormElementGetObjByName($oForm,"upfile");file 文本框
Local $oUpload= _IEFormElementGetObjByName($oForm,"upload");上传按钮
Local $oFilePath="C:\Users\linliangbai\Desktop\adf\123.zip";文件路径
;第一种情况
;有提示
MsgBox("","","1")
;给file文本框注册事件
_IEAction($oFile,"click")
;需要等浏览窗体关闭之后才会往下执行
MsgBox("","","2")
页:
[1]