whoami7 - Manager
:
/
home
/
bleuhbh
/
www
/
root
/
public
/
newRadio
/
Upload File:
files >> /home/bleuhbh/www/root/public/newRadio/webradioWorkingSingleFile.php
<?php // Set the folder path $musicDir = "../../../Musique Louis"; $files = scandir($musicDir); // Filter audio files $audioFiles = array_filter($files, function($file) { return preg_match('/\.(mp3|wav|flac)$/i', $file); }); // Choose one randomly $audioFiles = array_values($audioFiles); // reindex if (empty($audioFiles)) { http_response_code(404); echo "No audio files found."; exit; } $randomFile = $musicDir . '/' . $audioFiles[array_rand($audioFiles)]; // Get mime type $ext = strtolower(pathinfo($randomFile, PATHINFO_EXTENSION)); switch ($ext) { case 'mp3': $mime = 'audio/mpeg'; break; case 'wav': $mime = 'audio/wav'; break; case 'flac': $mime = 'audio/flac'; break; default: $mime = 'application/octet-stream'; } // Output headers header('Content-Type: ' . $mime); header('Content-Length: ' . filesize($randomFile)); header('Cache-Control: no-cache'); header('Connection: keep-alive'); // Stream the file readfile($randomFile); exit;
Copyright ©2021 || Defacer Indonesia