diff --git a/ci4/app/Controllers/Sistema/Intranet.php b/ci4/app/Controllers/Sistema/Intranet.php index 73aa48f2..e9da0b31 100644 --- a/ci4/app/Controllers/Sistema/Intranet.php +++ b/ci4/app/Controllers/Sistema/Intranet.php @@ -56,5 +56,27 @@ class Intranet extends Controller } } + function orden_trabajo($ot_id,$resource_name) + { + helper('file'); + $resource_path = WRITEPATH . 'uploads/orden_trabajo/'.$ot_id. '/' . $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(); + } + + } } \ No newline at end of file