<form name="form1" action="jsp2.jsp">
<span style="width: 0; overflow: hidden;">
<input type="file" name="file1" style="width: 300;" onchange="document.forms[0].submit();">
</span>
<input type="submit" value="aaa" onclick="document.form1.file1.click();">
</form>
这样为什么不正确
meizz(梅花雪) 于 2005-6-22 17:03:46
不要动这个歪脑筋了, MS早就把这个洞补上了. 你通过脚本触发type=file选中的文件根本就不能上传
正确的做法你可以document.createElement()创建出<input type=file>对象, 让用户一个个点击选中文件再上传.
===============================
此贴已经找到答案,麻烦版主删除,原来是IE的安全问题,我改思路,不用这个方法了.
<span style="width: 0; overflow: hidden;">
<input type="file" name="file1" style="width: 300;" onchange="document.forms[0].submit();">
</span>
<input type="submit" value="aaa" onclick="document.form1.file1.click();">
</form>
这样为什么不正确
meizz(梅花雪) 于 2005-6-22 17:03:46
不要动这个歪脑筋了, MS早就把这个洞补上了. 你通过脚本触发type=file选中的文件根本就不能上传
正确的做法你可以document.createElement()创建出<input type=file>对象, 让用户一个个点击选中文件再上传.
===============================
此贴已经找到答案,麻烦版主删除,原来是IE的安全问题,我改思路,不用这个方法了.
要结合Iframe才能绕过安全机制
不知道126.com的实现方法和google有什么不同没有