<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>FTP上传数据</title>
<link href="../css/css.css" rel="stylesheet" type="text/css">
<script language="javascript" src="../windclose.js"></script>
<style type="text/css">
body{
margin:0;
overflow:hidden;
}
</style>
</head>
<script language="javascript">
function onevent(action,params)
{
var srcpath=form1.txtqarpath.value;
var strfilter=form1.select_hzm.value;
var ftpup = document.getElementById("ftpupcom");
ftpup.SetIPddr("ftp://192.168.42.67"); //设置FTP脚务器的IP地址
ftpup.SetUserID("Administrator"); //设置FTP服务器的用户名
ftpup.SetPassWD("sunflower03"); //设置FTP脚务器的密码
ftpup.SetSrcPath(srcpath); //设置本地上传的文件路径
ftpup.SetDstPath("qar"); //设置上传到FTP脚务器的文件的目的路径
ftpup.SetFilter(strfilter); //设置目录上传文件的文件后缀名
ftpup.SetErrNo("2"); //设置FTP上传过程中最大连接错误则退出上传数
try
{
ftpup.Run();
alert("上传文件数:"+ftpup.GetSendFilesNo());
alert("成功上传!");
}
catch(e)
{
alert(e+'\n'+'请您确认FTP服务器是否运行正常!');
}
/*控件返回值的其它接口
ftpup.GetSendFiles(); //已传送的文件(用;隔开)
ftpup.GetFiles(); //所有传送的文件(用;隔开)
ftpup.GetSendNo(); //所有需要上传文件的记录数
ftpup.GetSendFilesNo(); //已上传文件的记录数
*/
}
function openwindow()
{
var someValue=window.showModalDialog("TransferFile.htm","","dialogWidth=550px;dialogHeight=350px;status=no;help=no;scrollbars=no");
document.form1.txtqarpath.value=someValue;
}
</script>
<body leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0" onload="">
<form action="" method="post" enctype="multipart/form-data" name="form1">
<table width="100%" border="0">
<tr>
<td><table width='100%' height=25 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width='1%' height=25 background='../image/skin1/er-cd.gif'> <img src='../image/skin1/ts.gif' width=3 height=15></td>
<td width='99%' background='../image/skin1/er-cd.gif'>
<table width='1%' border=0 align='left' cellpadding=0 cellspacing=0>
<tr>
<td> </td>
<td><img src='../image/skin1/button-t1_blue.gif' boder=0></td>
<td><input type="button" name="qd" value="确定上传" onClick="onevent('OnInput','')"></td>
<td><img src='../image/skin1/button-t2.gif' boder=0></td>
<td> </td>
</tr>
</table>
<table width='1%' border=0 align='left' cellpadding=0 cellspacing=0>
<tr>
<td> </td>
<td><img src='../image/skin1/button-t1_blue.gif' boder=0></td>
<td><input type="button" name="bclose" value="关闭" onClick="window.close();"></td>
<td><img src='../image/skin1/button-t2.gif' boder=0></td>
<td> </td>
</tr>
</table>
</table></td>
</tr>
</table>
<table width="80%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="20" colspan="2"> <div align="center"></div></td>
</tr>
<tr>
<td width="38%" height="15"><div align="right">文件后缀:</div></td>
<td width="62%">
<select name="select_hzm" id="select_hzm" style="width:30% ">
<option value="*.doc" selected>*.doc</option>
<option value="*.xsl" >*.xsl</option>
<option value="*.txt" >*.txt</option>
<option value="*.pdf" >*.pdf</option>
<option value="*.rar" >*.rar</option>
<option value="*.zip" >*.zip</option>
<option value="*.*" >*.*</option>
</select>
</td>
</tr>
<tr>
<td height="27"><div align="right">文件目录:</div></td>
<td><input name="txtqarpath" type="text" id="txtqarpath" style="width:450">
<input type="button" name="qdall2" value="浏览..." onClick="openwindow();">
</td>
</tr>
<tr>
<td height="38" colspan="2"> </td>
</tr>
<tr><DIV id=ftpupdiv style="display:none">
<object id='ftpupcom' classid='clsid:52B6B29A-ACE9-494C-B76F-7B21710CAFC3' codebase='BN_FTPUp.ocx'></object>
</DIV></tr>
</table>
<input type="submit" name="a" value="提交" style="display:none ">
<input type="hidden" name="parameters" value="">
<input type="hidden" name="action" value="">
<input type="hidden" name="selectdir" value="">
</form>
</body>
</html>
- 1
- 2
前往页