-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmyupload.php
54 lines (34 loc) · 942 Bytes
/
myupload.php
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
<?php
require_once('nucommon.php');
$uploaddir = sys_get_temp_dir();
$dq = '"';
$J = array();
foreach ($_FILES as $key){ //-- loop through uploaded files
$uploadfile = $uploaddir .'/'. basename($key['name']);
if(move_uploaded_file($key['tmp_name'], $uploadfile)){
$status = basename($key['name']);
}else{
$status = "Αποτυχία Μεταφόρτωσης";
}
$name = $key['name'];
$type = $key['type'];
$error = $key['error'];
$size = $key['size'];
$J[] = "{ |name| : |$name|, |type| : |$type|, |error| : |$error|, |size| : |$size| }" ;
}
$JSON = '[ ' . implode(', ', str_replace('|', '"', $J)) . ' ]';
$scr = "
<script>
function nuloadstats(){
parent.nuSetHash('FILES' , '$JSON');
parent.nuSetEdited();
}
</script>
<html>
<body onload='nuloadstats()'>
$status
</body>
</html>
";
print $scr;
?>