-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuploads.php
More file actions
64 lines (62 loc) · 1.32 KB
/
Copy pathuploads.php
File metadata and controls
64 lines (62 loc) · 1.32 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
<?php
if(!empty($_FILES['file'])){
foreach($_FILES['file']['name'] as $key => $name){
if($_FILES['file']['error'][$key] == 0 && move_uploaded_file($_FILES['file']['tmp_name'][$key],'upload/'.$name)){
$uploaded[] = $name;
}
}
if(!empty($_POST['ajax'])){
die(json_encode($uploaded));
}
}
?>
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="up.js"></script>
<style type="text/css">
#upload_progress{
display: none;
text-align: center;
line-height: 15px;
color:white;
}
#upload_bar{
display: none;
position: relative;
width:30%;
height: 15px;
background-color: #cedbd9;
}
#my_bar{
display: none;
position: absolute;
width: 0%;
height: 100%;
background-color: #3cd10e;
}
</style>
</head>
<body>
<div id="uploaded">
<?php
if(@$uploaded!=0 ){
foreach($uploaded as $name){
echo '<div><a href="upload/',$name,'">',$name,'</a></div>';
}
}
?>
</div>
<div id="upload_bar">
<div id="my_bar">
<div id="upload_progress"></div>
</div>
</div>
<div>
<form action="" method="post" enctype="multipart/form-data">
<input type="file" id="prakhar" name="file[]" multiple="multple"/>
<input type="submit" id="submit" value ="upload"/>
</form>
</div>
</body>
</html>