選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

dicom.php 1.1KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. // Il percorso al file DICOM sul server
  3. require_once '../../App/bootstrap.php';
  4. $attachId = isset($_GET['attach_id']) ? $_GET['attach_id'] : 0;
  5. if (!$user->isLogged()) {
  6. //exit(0);
  7. }
  8. $attach = $db->where('id', $attachId)->getOne('requests_attachments');
  9. $file_name = $attach['file_name'];
  10. $dicomFilePath = ATTACH_DIR . $file_name;
  11. echo $dicomFilePath;
  12. /*
  13. // Verifica che il file DICOM esista
  14. if (file_exists($dicomFilePath)) {
  15. // Imposta l'intestazione Content-Type per il file DICOM
  16. header('Content-Type: application/dicom');
  17. // Indica la lunghezza del file in modo che il client possa sapere quanto è grande
  18. header('Content-Length: ' . filesize($dicomFilePath));
  19. // Disabilita la memorizzazione nella cache per assicurarsi che il file venga sempre caricato
  20. header('Cache-Control: no-cache, must-revalidate');
  21. header('Expires: 0');
  22. // Leggi e trasmetti il file DICOM come se fosse il contenuto della risposta
  23. readfile($dicomFilePath);
  24. exit();
  25. } else {
  26. // Restituisci un errore 404 se il file non viene trovato
  27. http_response_code(404);
  28. echo "File non trovato.";
  29. }*/
  30. ?>