<style type="text/css">
.demo {
padding: 2em 0;
background: linear-gradient(to right, #2c3b4e, #4a688a, #2c3b4e);
}
.progress {
height: 25px;跨域有哪些方法
background: #262626;
jquery下载文件进度条padding: 5px;
overflow: visible;
border-radius: 20px;
border-top: 1px solid #000;
border-bottom: 1px solid #7992a8;
margin-top: 50px;
}
.progress .progress-bar {
border-radius: 20px;
position: relative;
animation: animate-positive 2s;
}
.progress .progress-value {
display: block;
padding: 3px 7px;
font-size: 13px;
color: #fff;
border-radius: 4px;
background: #191919;
border: 1px solid #000;
position: absolute;
top: -40px;
right: -10px;
truncated zip file怎么解决
}
.progress .progress-value:after {
content: "";
border-top: 10px solid #191919;
border-left: 10px solid transparent;创建一个spring项目
border-right: 10px solid transparent;
position: absolute;
bottom: -6px;
left: 26%;
}
.progress-bar.active {
animation: reverse progress-bar-stripes 0.40s linear infinite, animate-positive 2s;    }
@-webkit-keyframes animate-positive {
0% {
width: 0;
}
}
@keyframes animate-positive {
0% {
width: 0;
}
}
</style>
<body>
上传⽂件: <input type="file" name="file" id="myFile">
<button onclick="upload()">确认上传</button>
<div class="show_info">
⽂件信息:...
</div>
<div class="show_result">
返回结果:...
</div>
<button onclick="test()">测试按钮</button>
<div class="demo">
<div class="container">
<div class="row">
<div class="col-md-offset-3 col-md-6">
<div class="progress">
<div class="progress-bar progress-bar-info progress-bar-striped active" id="mt-progress-length"
>
<div class="progress-value" id="mt-progress-value">0%</div>
</div>
</div>
</div>
</div>
安装mysql后如何使用</div>
</div>
</body>
<script>
var totalSize = 0;驽马十驾造句
$(":file").change(function () {
var file = this.files[0];
var name = file.name;
var size = file.size;
var type = pe;
url = ateObjectURL(file);
totalSize += size;
$(".show_info").html("⽂件名:" + name + "<br>⽂件类型:" + type + "<br>⽂件⼤⼩:" + size + "<br>url: " + url);        console.log("ok");
// 恢复进度条的状态
//背景成绿⾊
$(".progress").css("background", "#262626");
//归零隐藏
$("#mt-progress-length").css({"width": "0%", "opacity": "1"});
$("#mt-progress-value").html(0);
})
function upload() {
//背景恢复
$(".progress").css("background", "#262626");
//归零隐藏
$("#mt-progress-length").css({"width": "0%", "opacity": "1"});
$("#mt-progress-value").html(0);
//创建formData对象初始化为form表单中的数据
//需要添加其他数据就可以使⽤ formData.append("property", "value");
var formData = new FormData();
var fileInput = ElementById("myFile");
var file = fileInput.files[0];
formData.append("file", file);
// ajax异步上传
$.ajax({
url: "localhost:1001/login/upload",
type: "POST",
data: formData,
contentType: false, //必须false才会⾃动加上正确的Content-Type
processData: false,  //必须false才会避开jQuery对 formdata 的默认处理
enctype: 'multipart/form-data',
xhr: function () {
//获取ajax中的ajaxSettings的xhr对象为他的upload属性绑定progress事件的处理函数

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。