Файловый менеджер - Редактировать - /home2/cocinasdalloway/lotes.cocinasdalloway.com/components/data/deleteFile.php
Назад
<?php header("Access-Control-Allow-Headers: X-API-KEY, Origin, X-Requested-With, Content-Type, Accept, Access-Control-Request-Method"); header('Access-Control-Allow-Origin: *'); header("Content-Type: application/json"); if ($_SERVER['REQUEST_METHOD'] === 'POST') { $requestData = json_decode(file_get_contents('php://input')); if (isset($requestData->imageId)) { $imageId = $requestData->imageId; $IdLote = $requestData->IdLote; // Manejar la carga del archivo $target_dir = "../../Images/".$IdLote."/". $imageId; if (file_exists($target_dir)) { if (unlink($target_dir)) { $arr = array('status' => 200, 'detail' => 'success', 'message' => 'Se elimino con exito'); } else { $arr = array('status' => 100, 'detail' => 'error', 'message' => 'No se puede eliminar el archivo: '.$target_dir); } echo json_encode($arr); }else{ $arr = array('status' => 100, 'detail' => 'error', 'message' => 'No se encontro el archivo: '.$target_dir); echo json_encode($arr); } // Delete the image from your server or database. // You will need to implement this part based on your server setup. // Respond with a success message or an error message. } else { echo json_encode(['error' => 'Invalid request']); } } else { echo json_encode(['error' => 'Invalid request method']); } ?>
| ver. 1.4 |
Github
|
.
| PHP 8.2.22 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка