-
Notifications
You must be signed in to change notification settings - Fork 2
/
demo.html
58 lines (55 loc) · 1.59 KB
/
demo.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
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>pithyUpload</title>
<script src="http://cdn.bootcss.com/jquery/1.11.2/jquery.min.js"></script>
<script type="text/javascript" src="jquery.pithyUpload.js"></script>
<script type="text/javascript">
$(function() {
$('#pithyUpload').pithyUpload({
trigger: 'change',
dataType: 'text',
allowedTypes: ["gif", "jpeg", "jpg", "bmp", "png"],
maxFiles: 8,
maxFileSize: 10 * 1024 * 1024,
extData: {
userid: 'gaoxin',
userpwd: '19931030'
},
onNewFile: function(file) {
console.log('new file:', file.name || file);
},
onComplete: function(data) {
if (data)
console.log('ie complete', data);
else
console.log('complete');
},
onUploadProgress: function(file, percent) {
console.log(file.name, percent);
},
onUploadSuccess: function(file, data, status, xhr) {
console.log(file.name, 'success - ', data);
},
onUploadError: function(file, xhr, status, err) {
console.log(file.name, 'error - ', status);
},
onFileTypeError: function(file) {
console.log('file type error', file);
},
onFileSizeError: function(file) {
console.log('file size error', file);
},
onFilesMaxError: function(file) {
console.log('files max error', file);
}
})
});
</script>
</head>
<body>
<input type="file" name="pithyUpload" id="pithyUpload" multiple="multiple">
</body>
</html>