-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhuptest.html
66 lines (66 loc) · 2.4 KB
/
huptest.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
<!DOCTYPE html>
<!-- Test page for interacting with the hup jquery plugin for file reading and uploading. See below for
the various events that are fired by the plugin. -->
<html>
<head>
<title>huptest</title>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script type="text/javascript" src="./hup.js"></script>
</head>
<body>
<form>
<input type="file" id="hupinput" multiple />
</form>
<div id="hupdiv" style="margin-top:60px; border:2px dashed #000;width:200px;height:100px;">
<p style="text-align:center;color:#777777;">--- Drop Target ---</p>
</div>
<script>
$('#hupinput').hup({accept:'mp4, mpeg, nana, wmv'})
.on('fileListLoaded', function(event, data){
console.log(data);
}).on('fileTypeError', function(event, data){
console.log(data);
}).on('fileSizeError', function(event, data){
console.log(data);
}).on('fileReadProgress', function(event, data){
console.log(data);
}).on('fileReadPause', function(event, data){
console.log(data);
}).on('fileReadResume', function(event, data){
console.log(data);
}).on('fileReadFinished', function(event, data){
console.log(data);
}).on('fileReadAll', function(event, data){
console.log(data);
});
// Specifying a url indicates we want to upload any files selected/dragged-and-dropped to this element
// Note the max_file_size set to 20MiB, in bytes
$('#hupdiv').hup({url:'huprec.php', accept:'image/*', max_file_size:20971520})
.on('fileListLoaded', function(event, data)
{
console.log(data);
}).on('fileTypeError', function(event, data)
{
console.log(data);
}).on('fileSizeError', function(event, data)
{
console.log(data);
}).on('fileUploadProgress', function(event, data)
{
console.log(data);
}).on('fileUploadPause', function(event, data)
{
console.log(data);
}).on('fileUploadResume', function(event, data)
{
console.log(data);
}).on('fileUploadFinished', function(event, data)
{
console.log(data);
}).on('fileUploadAll', function(event, data)
{
console.log(data);
});
</script>
</body>
</html>