-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathindex.html
74 lines (72 loc) · 2.19 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>UploadiFive Test</title>
<script src="jquery.min.js" type="text/javascript"></script>
<script src="jquery.uploadifive.min.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="uploadifive.css">
<style type="text/css">
body {
font: 13px Arial, Helvetica, Sans-serif;
}
.uploadifive-button {
float: left;
margin-right: 10px;
}
#queue {
border: 1px solid #E5E5E5;
height: 177px;
overflow: auto;
margin-bottom: 10px;
padding: 0 3px 3px;
width: 300px;
}
</style>
</head>
<body>
<h1>UploadiFive Demo</h1>
<form>
<div id="queue"></div>
<input id="file_upload" name="file_upload" type="file" multiple="true"/>
<input id="submit" type="button" onClick="javascript:$('#file_upload').uploadifive('upload')" value="上传"/>
</form>
<script type="text/javascript">
var timestamp = new Date();
$(function() {
$('#file_upload').uploadifive({
'auto' : false,
'checkScript' : 'check-exists.php',
'uploadScript' : 'uploadifive.php',
'formData' : {
'timestamp' : timestamp,
'token' : 'token'
},
'queueID' : 'queue',
"fileType": '.gif, .jpg, .png, .jpeg, .bmp, .doc, .ppt, .xls, .xlsx, .docx, .pptx, .zip, .rar, .pdf',
"auto": true,
"multi": true,
"height": 20,
"width": 100,
"fileSizeLimit": "20MB",
"uploadLimit": 10,
"buttonText": "选择附件",
'removeCompleted' : true,
'onUploadComplete' : function(file, data) {
var obj = JSON.parse(data);
console.log(data);
},
onCancel : function(file) {
alert(file.name + " 已取消上传~!");
},
onFallback : function() {
alert("该浏览器无法使用!");
},
onUpload : function(file) {
document.getElementById("submit").disabled = true;//当开始上传文件,要防止上传未完成而表单被提交
},
});
});
</script>
</body>
</html>