trabajando en la lista de tickets

This commit is contained in:
2025-02-15 17:54:49 +01:00
parent a616ec7ba7
commit 4a8aaf906c
15 changed files with 473 additions and 64 deletions

View File

@ -32,4 +32,29 @@ class Intranet extends Controller
}
function tickets($resource_name)
{
helper('file');
$resource_path = WRITEPATH . 'uploads/tickets/' . $resource_name;
if (file_exists($resource_path)) {
// Get the mime type of the file
$mime_type = mime_content_type($resource_path);
// Get an instance of the Response class
$response = service('response');
// Set the content type
$response->setContentType($mime_type);
// Set the output
$response->setBody(file_get_contents($resource_path));
// Send the response to the browser
$response->send();
}
}
}