Файловый менеджер - Редактировать - /home2/cocinasdalloway/lotes.cocinasdalloway.com/Administrador/Home/upload.php
Назад
<?php $idAdministrador=$_GET['IdAdministrador']; $uploadDir = '../uploads/'.$idAdministrador.'/'; // Specify your upload directory if (!file_exists($uploadDir)) { mkdir($uploadDir, 0777, true); } $existingFile = glob($uploadDir . '*'); if (!empty($existingFile)) { // Eliminar el archivo existente unlink($existingFile[0]); } if (!empty($_FILES)) { $tempFile = $_FILES['file']['tmp_name']; $targetFile = $uploadDir . $_FILES['file']['name']; // Validate file type $fileType = strtolower(pathinfo($targetFile, PATHINFO_EXTENSION)); $allowedTypes = array('doc', 'docx'); if (in_array($fileType, $allowedTypes)) { move_uploaded_file($tempFile, $targetFile); echo 'File uploaded successfully.'; } else { echo 'Invalid file type. Allowed types: doc, docx.'; } } ?>
| ver. 1.4 |
Github
|
.
| PHP 8.2.22 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка