-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupload.php
More file actions
33 lines (20 loc) · 826 Bytes
/
Copy pathupload.php
File metadata and controls
33 lines (20 loc) · 826 Bytes
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
<?php
class upload{
public function __construct(){
}
public function func(){
$uploaddir = '../public_html/img/saved1/';
$fh = fopen("testfile30.txt", 'w') or die("Failed to create file");
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
$text = 'Файл корректен и был успешно загружен'.$uploadfile;
fwrite($fh, $text) or die("Could not write to file");
} else {
$text = 'Возможная атака с помощью файловой загрузки!!!!'.$uploadfile;
fwrite($fh, $text) or die("Could not write to file");
}
fclose($fh);
return $uploadfile;
}
}
?>