__MY_ROOT_PUBLIC__.'static/upload/video/', 'file' => __MY_ROOT_PUBLIC__.'static/upload/file/', 'image' => __MY_ROOT_PUBLIC__.'static/upload/images/', ]; foreach($path_all as $type=>$path) { $path = GetDocumentRoot() . (substr($path, 0, 1) == "/" ? "":"/") . $path; $handle = opendir($path); while(false !== ($file = readdir($handle))) { if($file != 'index.html' && $file != '.' && $file != '..' && substr($file, 0, 1) != '.') { $ret = ResourcesService::AttachmentDiskFilesToDb($file); if(isset($ret['msg'])) { echo $ret['msg']; } } } } } } ?>