Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
Your IP : 18.225.92.251
Current Path : /var/www/html/oums/src/ |
| Current File : /var/www/html/oums/src/departments_logo_upload.php |
<?php
ini_set('post_max_size', '64M');
ini_set('upload_max_filesize', '64M');
$file_resp = "";
if (0 < $_FILES['file']['error']) {
echo 'Error: ' . $_FILES['file']['error'] . '<br>';
$file_resp = "Failed to upload file!";
} else {
// $file_text = str_replace(' ','_',strtolower($_POST['text']));
// $file_text = preg_replace('/[^A-Za-z0-9\-]/', '', $file_text);
$file_name = '../img-dept/' . strtolower(str_replace(' ', '_', $_POST['text'] . "_" . $_FILES['file']['name'])); //
if (file_exists("$file_name")) {
unlink("$file_name");
}
move_uploaded_file($_FILES['file']['tmp_name'], $file_name);
}
echo $file_resp;
|