フォルダ構造PHPのフォルダからすべてのファイルを取得
Main Folder
->(1)SS (subFolder) contain 15 Png Images
-> Main Movie File (700Mb)
-> Sample.mkv (14Mb)
PHPコード
$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;
}
ヘッダ( 'コンテンツタイプ:アプリケーション/ JSON')。
echo json_encode($response);
は、私はすべてのファイルは、メインムービーファイル(700MB)を期待し得るであるという問題 がここ
Working Exampleはまたショーの700メガバイトのソートが必要ですまず、他のファイルを表示
'scandir($ dir)'の返された配列にもメインビデオファイルが抜けていますか? – Thoby
はいメインビデオはscandir($ dir)の返信で使命ですが、pngファイルを削除すると終了します。その後json_encodeのメインビデオファイルが表示されます – Amitya
https://cdn.pbrd.co/images/6akIyag4u.png – Amitya