Download CAD files:
[insert_php]
if (is_user_logged_in() ){
if ($handle = opendir(‘wp-content/uploads/cad_files/’)) {
while (false !== ($entry = readdir($handle))) {
if ($entry != “.” && $entry != “..”) {
echo ““.$entry.”\n”;
}
}
closedir($handle);
}
} else {
echo “Please log in first.”;
wp_login_form( array( ‘echo’ => true ) );
}
[/insert_php]