代码如下:
<form method="post" target="hidden_frame" id='upload'>
<input id="uploadIpt" type="file" name="pic" />
</form>
<button class="button">上传图片</button>
$('.button').click(function(){
$('#uploadIpt').trigger('click');//这句代码触发点击文件上传input
});
$('#uploadIpt').change(function(){
//formSubmit();
})
以前开发时在chrome中也测试过,完全没有问题。现在不知道为什么,点击后选择图片的那个弹窗出现的很慢。
求大神支招!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
input file accept指明具体的类型,不要带有
image/*这样的通配如
accept="image/jpeg,image/png,image/gif"好像是Chrome后面更新后的Bug,很早就有了
感谢楼上。。。。
貌似是chrome会对zip等文件会检查.
http://blog.csdn.net/mingover...