想一个文件到服务器上,不用input type=file .
想上传一个文件到服务器上,不用input type=file .
文件为 aa.txt
可以知道 客户端地址:string userpath="c:\aa.txt";
想传到服务器:string serverpath="http:/localhost/flies/aa.txt";
想很多方法,也在网上找过很多,还是没有结果.
获得客户端地址我这样写(只用file选择)
<script language="javascript">
function UploadFile(){
var t=document.createElement('input');//新建input
t.setAttribute('id','temp_file');//设置id号
t.setAttribute('type','file');//类型
t.style.display='none';//不显示
//加事件
t.onchange=function(){document.getElementById('TextBox1').value=t.value;document.body.removeChild(t);};
//保存到body
document.body.appendChild(t);
//运行事件
t.click();
}
</script>
这样就得到客户端地址了.
问题是怎么样把客户端的文件传到服务器.
请高手帮助.请有过这样经验的人帮助.