forked from i5ting/uploadify
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.html
executable file
·44 lines (42 loc) · 1.06 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
<html>
<head>
<link href="./css/uploadfile.css" rel="stylesheet">
<script src="./jquery.js"></script>
<script src="./js/jquery.uploadfile.min.js"></script>
</head>
<body>
<div id="fileuploader">Upload</div>
<script>
$(document).ready(function() {
$("#fileuploader").uploadFile({
url:"/fileupload/",
fileName:"myfile",
multiple:true,
dragDrop:true,
showDownload:true,
showDelete: true,
onSuccess: function (files, response, xhr, pd) {
alert(JSON.stringify(files));
},
statusBarWidth:600,
dragdropWidth:600,
deleteCallback: function (data, pd) {
for (var i = 0; i < data.length; i++) {
alert(data);
$.post("delete.php", {op: "delete",name: data[i]},
function (resp,textStatus, jqXHR) {
//Show Message
alert("File Deleted");
});
}
pd.statusbar.hide(); //You choice.
},
downloadCallback:function(filename,pd)
{
location.href="download.php?filename="+filename;
}
});
});
</script>
</body>
</html>