Can you help me to store or insert the scanned file in the database by basename and sized. `function videoTry() {
$path = ('/mnt/HD/HD_a2/'); $it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::SKIP_DOTS)); $allowed = array( "mp4","mov", "xvid", "m4v", "avi", "wmv", "asf", "flv", "f4v", "mkv", "ts", "m2ts", "mts", "tp", "trp", "mpg", "mpeg", "vob", "avs", "3gp", "3gp2", "webm", "ogm" ); header("Content-Type: text/xml"); $xml = new SimpleXMLElement('<config/>'); $xml_display = $xml->addChild('nas_sharing'); $count = $xml_display->addChild('auth_state', "1"); foreach ($it as $file){ if (!in_array(pathinfo($file, PATHINFO_EXTENSION), $allowed)) continue; $xml_item = $xml->addChild('item'); $xml_item->addChild('video', htmlspecialchars($file)); $xml_item->addChild('size', filesize($file)); } echo $xml->asXml();
}`
No comments:
Post a Comment