tasktypes_files.php 637 B

1234567891011121314151617181920212223
  1. <?
  2. header('Content-Type: application/json');
  3. include "functions.php";
  4. $activeid = $_REQUEST['id'];
  5. $hostpath = $_SERVER['SERVER_NAME'];
  6. $imgpath = GetVideoPathFromTasktype($activeid);
  7. $files1 = scandir($imgpath);
  8. $filearray = array();
  9. if (sizeof($files1) > 2)
  10. {
  11. foreach ($files1 as $file )
  12. {
  13. $x = pathinfo($file)['extension'];
  14. if($file === '.' || $file === '..') {continue;}
  15. if ($x == 'mp4' || $x == 'jpg' || $x == 'jpeg' || $x == 'pdf') {
  16. array_push($filearray, "http://$hostpath/$imgpath$file");
  17. }
  18. }
  19. $json = json_encode($filearray);
  20. echo $json;
  21. // var_dump($json);
  22. }