哪位高手有能力帮我改改这个看看可否实现我要的效果?这里看不出应该在哪里上传?
我希望的是不按“浏览”也不按“提交”,只是在其它地方模拟点击而实现上传图片到服务器的效果,但是目前看来给FILE赋值是禁止的,或者会有安全提示,这些都不是我想要的。
<head>
</head>
<body>
<form name=fm1>
<div id=bxAttList>
<div id=bxAtt onmouseover="$('bxAtt1').style.textDecoration='underline'" onmouseout="$('bxAtt1').style.textDecoration=''" style=float:left;width:60>
<span id=bxAtt1 style='position:absolute;padding-top:3;cursor:hand;font-family:宋体'>@添加附件</span>
<span id=bxAtt2 onmouseover=this.scrollLeft=100 style=position:absolute;width:60;overflow:hidden;filter:alpha(opacity=0);-moz-opacity:0></span>
    </div>
</div>
</form>
</body>
<script>
file_create()
function file_create(){
    $("bxAtt2").innerHTML="<input onchange=file_change(this) hidefocus type=file name=file1 size=1 >"
}
function file_change(tx){
    var sName,o
    sName=tx.value.replace(/\\/g,"/").replace(/(.*\/)(.*)/,"$2")
    o=document.createElement("nobr")
    o.style.cssText="float:left;margin-right:6;padding-top:3;color:darkgreen"
    o.innerHTML="□"+sName+"<font onclick=$('bxAttList').removeChild(this.parentNode);file_repos() class=hand style=color:red;font-weight:bold>"+unescape("%d7")+"</font>"
    tx.style.display="none"
    o.appendChild(tx)
    $("bxAttList").insertBefore(o,$("bxAtt"))
    file_repos()
    file_create()
}
function file_repos(){
    $("bxAttList").appendChild($("bxAtt"))
}
function $(obj){
    return typeof(obj)=="object"?obj:document.getElementById(obj)
}
</script>
 </body>
</html>
或者看看修改这个无法赋值错在哪?(模拟点击不用管)<form name="myform" id="frm" action="" method="post" enctype="multipart/form-data">  <input type="text" name="file2" id="file2" readonly="true">
  <input type="button" name="Submit" value="Browse" onClick="cc()">
  <br />
  <input type="file" name="file" id="file1" style="display:block;" onChange="this.form.file2.value=value">
  <input type="submit" name="Submit1" value="提交" >
</form>
<script>
function dd()
{
document.getElementById("file2").value="ddddd"
cc()
}function cc()
{
document.myform.form.file1.click();
}
</script>
<input type="submit" name="Submit2" value="提交" onClick="dd()">

解决方案 »

  1.   

    如果不想公开,请直接发到我邮箱也行:[email protected]
      

  2.   

    既然是VB截图,就可以直接用VB通过WINSOCK批量上传了。
      

  3.   

    FTP上传要虚机密码。对于公开的软件来说安全吗?
      

  4.   

    不是FTP上传。是WINSOCK的TCP/UDP,不用FTP,无需任何密码和权限,只要相应的端口开着。或者,如果那上面有数据库的话,就用数据入库的方法即可,通过连接对象连数据库系统的端口进行SQL操作了(可以把图片二进制数据直接入库)。
      

  5.   

    不过作为公开的软件,如果直接含有数据库的连接串信息(用户,口令),有点不太安全。所以最好还是通过WINSOCK,服务端相应作个接收程序。