-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathp.imageuploader.html
115 lines (105 loc) · 3.59 KB
/
p.imageuploader.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<!DOCTYPE html>
<html>
<head>
<title>Inputs plugin</title>
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="stylesheet" type="text/css" href="library/style.css">
<link rel="stylesheet" href="https://libraries.weblabor.mx/w3.css">
</head>
<body>
<img src="logo.png" width="400" />
<ul>
<li><a href="index-old.html">Return</a></li>
</ul>
<span id="form-msg"></span>
<h1>Ajax Image Uploader</h1>
<div class="w3-row">
<div class="w3-container w3-half">
<!-- D&D Zone-->
<div data-type="imageUploader" src="https://libraries.weblabor.mx/easy-js-library/upload.php" class="uploader">
<div>Drag & Drop Images Here</div>
<div class="or">-or-</div>
<div class="browser">
<label>
<span>Click to open the file Browser</span>
<input type="file" name="files[]" accept="image/*" multiple="multiple" title='Click to add Images'>
</label>
</div>
</div>
<!-- /D&D Zone -->
<!-- Debug box -->
<div class="panel panel-default w3-card">
<div class="w3-container w3-light-grey">
<h4>Debug</h4>
</div>
<div class="panel-body demo-panel-debug w3-container">
<ul id="demo-debug">
</ul>
</div>
</div>
<!-- /Debug box -->
</div>
<div class="w3-container w3-half">
<div class="w3-card">
<div class="w3-container w3-light-grey">
<h4>Uploads</h4>
</div>
<div class="panel-body demo-panel-files w3-container" id='demo-files'>
<span class="demo-note">No Files have been selected/droped yet...</span>
</div>
</div>
</div>
</div>
<h3>HTML</h3>
<code data-type="codeeditor" data-lang="html"><div class="w3-row">
<div class="w3-container w3-half">
<!-- D&D Zone-->
<div data-type="imageUploader" src="upload.php" class="uploader">
<div>Drag &amp; Drop Images Here</div>
<div class="or">-or-</div>
<div class="browser">
<label>
<span>Click to open the file Browser</span>
<input type="file" name="files[]" accept="image/*" multiple="multiple" title='Click to add Images'>
</label>
</div>
</div>
<!-- /D&D Zone -->
<!-- Debug box -->
<div class="panel panel-default w3-card">
<div class="w3-container w3-light-grey">
<h4>Debug</h4>
</div>
<div class="panel-body demo-panel-debug w3-container">
<ul id="demo-debug">
</ul>
</div>
</div>
<!-- /Debug box -->
</div>
<div class="w3-container w3-half">
<div class="w3-card">
<div class="w3-container w3-light-grey">
<h4>Uploads</h4>
</div>
<div class="panel-body demo-panel-files w3-container" id='demo-files'>
<span class="demo-note">No Files have been selected/droped yet...</span>
</div>
</div>
</div>
</div></code>
<h3>PHP</h3>
<code data-type="codeeditor" data-lang="php"><?php
$res = "failed";
foreach ($_FILES as $file) {
$tmp_name = $file["tmp_name"];
$name = $file["name"];
$res = "Successfull";
move_uploaded_file($tmp_name, $name);
}
echo json_encode(array('status' => $res));
?></code>
<script type="text/javascript" src="library/jquery.min.js"></script>
<script type="text/javascript" src="library/script.js"></script>
</body>
</html>