Preparando proyecto para migración a repositorio MVE
This commit is contained in:
36
public/test_import.php
Normal file
36
public/test_import.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
session_start();
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
header('Access-Control-Allow-Origin: *');
|
||||
header('Access-Control-Allow-Methods: POST, GET, OPTIONS');
|
||||
header('Access-Control-Allow-Headers: Content-Type');
|
||||
|
||||
// Simple test endpoint
|
||||
$response = [
|
||||
'success' => true,
|
||||
'message' => 'Conexión exitosa desde public',
|
||||
'timestamp' => date('Y-m-d H:i:s'),
|
||||
'method' => $_SERVER['REQUEST_METHOD'],
|
||||
'usuario' => isset($_SESSION['usuario']) ? $_SESSION['usuario']['nombre'] ?? 'Usuario logueado' : 'No hay usuario',
|
||||
'post_data' => $_POST,
|
||||
'get_data' => $_GET,
|
||||
'server_info' => [
|
||||
'HTTP_HOST' => $_SERVER['HTTP_HOST'],
|
||||
'REQUEST_URI' => $_SERVER['REQUEST_URI'],
|
||||
'SCRIPT_NAME' => $_SERVER['SCRIPT_NAME']
|
||||
]
|
||||
];
|
||||
|
||||
if (isset($_FILES['archivo'])) {
|
||||
$response['files_data'] = [
|
||||
'nombre' => $_FILES['archivo']['name'],
|
||||
'tamaño' => $_FILES['archivo']['size'],
|
||||
'tipo' => $_FILES['archivo']['type'],
|
||||
'error' => $_FILES['archivo']['error']
|
||||
];
|
||||
} else {
|
||||
$response['files_data'] = 'No hay archivo';
|
||||
}
|
||||
|
||||
echo json_encode($response, JSON_PRETTY_PRINT);
|
||||
?>
|
||||
Reference in New Issue
Block a user