-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathindex.html
More file actions
66 lines (63 loc) · 2.06 KB
/
index.html
File metadata and controls
66 lines (63 loc) · 2.06 KB
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
<html>
<head>
<link href="https://rawgithub.com/hayageek/jquery-upload-file/master/css/uploadfile.css" rel="stylesheet">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="https://rawgithub.com/hayageek/jquery-upload-file/master/js/jquery.uploadfile.min.js"></script>
</head>
<body>
<div id="deleteupload">Upload</div>
<script>
$("#deleteupload").uploadFile({
url: "http://localhost/uploader/php/upload.php",
dragDrop: true,
multiple:true,
acceptFiles:"image/*",
allowedTypes:"jpg,png,gif",
showPreview:true,
previewHeight: "100px",
previewWidth: "100px",
maxFileSize:20000*1024,
maxFileCount:3,
fileName: "myfile",
returnType: "json",
showDelete: true,
showDownload:true,
statusBarWidth:600,
dragdropWidth:600,
onSuccess:function(files,data,xhr,pd)
{
location.reload();
},
onLoad:function(obj)
{
$.ajax({
cache: false,
url: "http://localhost/uploader/php/load.php",
dataType: "json",
success: function(data)
{
for(var i=0;i<data.length;i++)
{
obj.createProgress(data[i]["name"],data[i]["path"],data[i]["size"]);
}
}
});
},
deleteCallback: function (data, pd) {
for (var i = 0; i < data.length; i++) {
$.post("http://localhost/uploader/php/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="http://localhost/uploader/php/download.php?filename="+filename;
}
});
</script>
</body>
</html>