folder structure
Main Folder
->(1)SS (subFolder) contain 15 Png Images
-> Main Movie File (700Mb)
-> Sample.mkv (14Mb)
php code
$dir = "download/a176b8a9f5575a08eac602adfdc78f666e3695a2";
$response = scan($dir);
function scan($dir){
if(file_exists($dir)){
foreach(scandir($dir) as $f) {
if(!$f || $f[0] == '.') {
continue; // Ignore hidden files
}
if(is_dir($dir . '/' . $f)) {
// The path is a folder
$files = scan($dir . '/' . $f); // Recursively get the contents of the folder}
else {
// It is a file
$files[] = array(
"name" => $f,
"type" => "file",
"path" => $dir . '/' . $f,
"size" => filesize($dir . '/' . $f) // Gets the size of this file
);
}
}
}
return $files;
}
header('Content-type: application/json');
echo json_encode($response);
The problem Is i get All File Expect Main Movie File (700Mb) here is
Working ExampleAlso Need Sorting show 700mb First then show other file