引入样式和js文件

    <link href="css/bootstrap.min.css" type="text/css" rel="stylesheet"/>
<link rel="stylesheet" href="css/jquery.fileupload.css">
<link rel="stylesheet" href="css/jquery.fileupload-ui.css">
<script src="js/jquery.js"></script>
<script src="js/jquery.ui.widget.js"></script>
<script src="js/jquery.fileupload.js"></script>

html

<body>
<div class="row fileupload-buttonbar" style="padding-left:15px;">
<div class="thumbnail col-sm-6">
<img id="weixin_show" style="height:180px;margin-top:10px;margin-bottom:8px;" src="__PUBLIC__/images/game/game_1.png" data-holder-rendered="true">
<div class="progress progress-striped active" role="progressbar" aria-valuemin="10" aria-valuemax="100" aria-valuenow="0">
<div id="weixin_progress" class="progress-bar progress-bar-success" style="width:0%;"></div>
</div>
<div class="caption" align="center">
<span id="weixin_upload" class="btn btn-primary fileinput-button">
<span>上传</span>
<input type="file" id="weixin_image" name="files" multiple>
</span>
<a id="weixin_cancle" href="javascript:void(0)" class="btn btn-warning" role="button" onclick="cancleUpload('weixin')" style="display:none">删除</a>
</div>
</div>
</div>
</body>

上传ajax:

    <script type="text/javascript">
$(function() {
$("#weixin_image").fileupload({
url: 'http://www.test007.com/ser/api/json/file/upload/batch',
sequentialUploads: true
}).bind('fileuploadprogress', function (e, data) { //主要是进度条的修改
var progress = parseInt(data.loaded / data.total * 100, 10);
$("#weixin_progress").css('width',progress + '%');
$("#weixin_progress").html(progress + '%');
}).bind('fileuploaddone', function (e, data) { //上传结束后执行的操作
var imgurl = JSON.parse(data.result).data;
$("#weixin_show").attr("src", imgurl);
$("#weixin_upload").css({display:"none"});
$("#weixin_cancle").css({display:""});
}); }); </script>

jquery-file-upload附件上传的更多相关文章

  1. jQuery File Upload 图片上传解决方案兼容IE6+

    1.下载:https://github.com/blueimp/jQuery-File-Upload 2.命令: npm install bower install ================= ...

  2. jQuery File Upload 文件上传插件使用一 (最小安装 基本版)

    jQuery File Upload 是一款非常强大的文件上传处理插件,支持多文件上传,拖拽上传,进度条,文件验证及图片音视频预览,跨域上传等等. 可以说你能想到的功能它都有.你没想到的功能它也有.. ...

  3. jQuery File Upload文件上传插件简单使用

    前言 开发过程中有时候需要用户在前段上传图片信息,我们通常可以使用form标签设置enctype=”multipart/form-data” 属性上传图片,当我们点击submit按钮的时候,图片信息就 ...

  4. jquery file upload 文件上传插件

    1. jquery file upload 下载 jquery file upload Demo 地址:https://blueimp.github.io/jQuery-File-Upload/ jq ...

  5. jQuery File Upload 文件上传插件使用二 (功能完善)

    使用Bootstrap美化进度条 Bootstrap现在几乎是人尽皆知了,根据它提供的进度条组件, 让进度条显得高大尚点 正因为其功能强大,js模块文件之间牵连较深 不好的地方耦合度非常高 重要的参数 ...

  6. Springmvc file多附件上传 显示 删除操作

    之前项目需求要做一个多附件上传 并显示上传文件 带删除操作 一筹莫展之际搜到某个兄弟发的博客感觉非常好用被我copy下来了此贴算是改良版 再次感谢(忘记叫什么了时间也有点久没有历史记录了)先上图 基于 ...

  7. DVWA之File Upload (文件上传漏洞)

    目录 Low: Medium: 方法一:抓包修改文件的type 方法二:00截断 High: Impossible : Low: 源代码: <?php if( isset( $_POST[ 'U ...

  8. java附件上传下载磁盘版

    ACTION public class UploadAction extends BaseAction { private static final long serialVersionUID = 1 ...

  9. 用jQuery File Upload做的上传控件demo,支持同页面多个上传按钮

    需求 有这么一个需求,一个form有多个文件要上传,但又不是传统的图片批量上传那种,是类似下图这种需求,一开始是用的swfupload做的上传,但是问题是如果有多个按钮的话,就要写很多重复的代码,于为 ...

  10. jQuery File Upload跨域上传

    最近在做一个一手粮互联网项目,方案为前后端分离,自己负责前端框架,采用了Requirejs+avalonjs+jquery三个框架完成. 前后端通过跨域实现接口调用,中间也发现了不少问题,尤其是在富文 ...

随机推荐

  1. malefile

    什么是makefile?或许很多Winodws的程序员都不知道这个东西,因为那些Windows的IDE都为你做了这个工作,但我觉得要作一个好的和professional的程序员,makefile还是要 ...

  2. js控制表单操作的常用代码小结

    收集了一些在WEB前台开发中常用的一些控制表单操作函数. 1.鼠标经过时自动选择文本鼠标划过自动选中:<input type="text" value="默认值&q ...

  3. modelsim常见错误

    1. Error: (vlog-7) Failed to open design unit file "D:/Xilinx/verilog/src/glbl.v" in read ...

  4. android.content.res.TypedArray-深入理解android自定义属性(AttributeSet,TypedArray)

    属性 自定义属性,首先要定义出来属性,我们新建一个attrs.xml: <?xml version="1.0" encoding="utf-8"?> ...

  5. 原来npm的依赖树管理不靠谱

    今天删除了一个模块,结果发现项目编译无法成功,缺依赖,然后再安装也不行了.只好把node_modules清空,重新npm install,项目恢复正常. npm uninstall的时候,可能把现存某 ...

  6. Facebook提出DensePose数据集和网络架构:可实现实时的人体姿态估计

    https://baijiahao.baidu.com/s?id=1591987712899539583 选自arXiv 作者:Rza Alp Güler, Natalia Neverova, Ias ...

  7. <实战> 通过分析Heap Dump 来了解 Memory Leak ,Retained Heap,Shallow Heap

    引入: 最近在和别的团队的技术人员聊天,发现很多人对于堆的基本知识都不太熟悉,所以他们不能很好的检测出memory leak问题,这里就用一个专题来讲解如何通过分析heap dump文件来查找memo ...

  8. 什么是GC Roots

    GC Root 2012年11月28日  ⁄ 综合 ⁄ 共 625字 ⁄ 字号  小 中 大  ⁄ 评论关闭   常说的GC(Garbage Collector) roots,特指的是垃圾收集器(Ga ...

  9. iOS截屏功能

    代码: - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. // ...

  10. 随记MySQL的时间差函数(TIMESTAMPDIFF、DATEDIFF)、日期转换计算函数(date_add、day、date_format、str_to_date)

    时间差函数(TIMESTAMPDIFF.DATEDIFF) 需要用MySQL计算时间差,使用TIMESTAMPDIFF.DATEDIFF,记录一下实验结果 select datediff(now(), ...