IE8下上传文件方式
来源:互联网 发布:网络剧怎么备案 编辑:程序博客网 时间:2024/06/05 19:48
1.准备页面,
加入
<form name="uploadform" id="uploadform" method="post" action="queryCriteriaBD!uploadImageProxy.action" target="file_upload_return" enctype="multipart/form-data">
<div class="top-nav-condition-left-xuanze-imgbox">
<a class="btn_addPic" href="javascript:void(0);" title="支持jpg、jpeg格式,文件小于5M">
<img class="top-nav-condition-left-xuanze-img" id="top_nav_condition_left_xuanze_img" title="支持jpg、jpeg格式,文件小于5M" src="../../srtProject/sysc/imgs/SelectImg.png"/>
<div class="top-nav-condition-left-xuanze-img" id="top_nav_condition_left_xuanze_imgDiv" style="display:none;"></div>
<input type="file" tabIndex="3" size="3" class="filePrew" onchange="chacgeImg(this.value);" id="file" name="file" title="支持jpg、jpeg格式,文件小于5M">
</a>
</div>
<div class="top-nav-condition-left-xuanze-btnbox" style="display:block;">
<input type="submit" class="frame-btn top-nav-condition-left-xuanze-btn1" value="上传图片" id="file_up">
</div>
</form>
<iframe name="file_upload_return" id="file_upload_return" style="width:0px;height:0px;border:none;overflow:hidden;"></iframe>
2.在js中加入
//图片预览chacgeImg
function chacgeImg(value){
jQuery("#loadgif").css("display","block");
var imgType=value.substring(value.lastIndexOf("."));
if(imgType!=".jpg" && imgType!=".JPG"){
jQuery("#loadgif").css("display","none");
window.alert("图片只支持(.jpg、.JPG)格式");
}else{
jQuery("#loadgif").css("display","none");
jQuery("#top_nav_condition_left_xuanze_img").css("display","none");
var imgDiv = document.getElementById("top_nav_condition_left_xuanze_imgDiv");
imgDiv.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod = scale)";
imgDiv.filters("DXImageTransform.Microsoft.AlphaImageLoader").src = value;
jQuery("#top_nav_condition_left_xuanze_imgDiv").css("display","block");
}
}
3.返回iframe的加载成功方法:
jQuery("#file_upload_return").load(function(){
var bodyContent = window.frames["file_upload_return"].document.body.innerHTML;
alert(bodyContent );
});
4.完成了上传文件,并获取返回值信息。
- IE8下上传文件方式
- IE8 下的文件上传问题
- ie8文件上传onchange无效
- IE8 springmvc支持文件上传
- WEB方式下客户端无法上传文件
- 文件上传一些事(ie8/9下提示下载json文件)
- ie8下使用jquery-file-upload上传文件后返回json格式数据提示下载
- IE8下ajaxFileUpload上传文件成功,但不进入回调函数,而是提示下载信息
- eWebEditor在ie8下上传失效(转)
- IE8 上传文件出现C:\fakepath\错误
- 兼容ie8的ajax文件上传
- IE8+SpringMVC文件上传防止JSON下载
- 兼容IE8使用ajax上传文件
- 兼容ie8的多文件上传
- webuploader 文件上传插件 IE8/9 文件选择不上传
- post方式下载文件ie8不支持
- Servlet3.1下@MultipartConfig注解方式上传文件
- Servlet方式文件上传
- 顺序表(动态)
- C语言使用递归求N的阶乘
- win10重装有感
- C++中将vector<float>的数据进行base64加密存储到数据库中(内含base64源码)
- 欢迎使用CSDN-markdown编辑器
- IE8下上传文件方式
- QualComm Debug
- 【Python学习】打印10000以内的所有素数
- Jmeter配置元件_用户定义的变量
- GMIS 2017大会邓力演讲:无监督学习的前沿与SPDG方法的优良性
- 字符串反转实现
- ACM 中的 关于 io
- 参加全国大学生计算机应用能力与素养大赛感想
- 思想决定行为,行为决定习惯,习惯决定性格,性格决定命运