Index: temp/trunk/html/test/uehara/tree.php
===================================================================
--- temp/trunk/html/test/uehara/tree.php	(revision 8588)
+++ temp/trunk/html/test/uehara/tree.php	(revision 8589)
@@ -23,11 +23,26 @@
 case 'download':	
 case 'delete':
-	// ½é´üÉ½¼¨°Ê³°¤Ï¸½ºßÁªÂòÃæ¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ò¼èÆÀ
-	$now_dir = $_POST['select_file'];
-	
+	// ¸½ºß¤Î¥Õ¥©¥ë¥À¤òÉ½¼¨
+	$now_dir = $_POST['now_file'];
+
 case 'view':
+	// ÁªÂò¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ê¤é°ÜÆ°
+	if(is_dir($_POST['select_file'])) {
+		$now_dir = $_POST['select_file'];
+	} else {
+		// javascript¤ÇÊÌÁëÉ½¼¨(¥Æ¥ó¥×¥ì¡¼¥ÈÂ¦¤ËÅÏ¤¹)
+		$objPage->tpl_javascript = "win02('". $_POST['select_file'] ."', 'user_data', '600', '400');";
+		exit;
+	}
 	break;
 
 case 'download':
+	if(is_dir($_POST['select_file'])) {
+		// ¥Ç¥£¥ì¥¯¥È¥ê¤Î¾ì¹ç¤Ïjavascript¥¨¥é¡¼
+		$objPage->tpl_javascript = "alert('¢¨¡¡¥Ç¥£¥ì¥¯¥È¥ê¤ò¥À¥¦¥ó¥í¡¼¥É¤¹¤ë¤³¤È¤Ï½ÐÍè¤Þ¤»¤ó¡£');";
+	} else {
+		// ¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¤Ï¥À¥¦¥ó¥í¡¼¥É¤µ¤»¤ë
+		header('Content-Disposition: attachment; filename="'. basename($_POST['select_file']) .'"');
+	}
 	break;
 	
@@ -67,5 +82,5 @@
 				// ./ ¤È ../¤ò½ü¤¯¥Õ¥¡¥¤¥ë¤Î¤ß¤ò¼èÆÀ
 				if($file != "." && $file != "..") {
-sfprintr($file);	// ¹ÔËö¤Î/¤ò¼è¤ê½ü¤¯
+					// ¹ÔËö¤Î/¤ò¼è¤ê½ü¤¯
 					$dir = ereg_replace("\/$", "", $dir);
 					$path = $dir."/".$file;
@@ -94,9 +109,10 @@
 		if (is_dir($dir)) {
 		    $handle = opendir($dir); 
-		    while ($file = readdir($handle)) { 
-		        if ($file != '..' && $file != '.' && !is_dir($dir.'/'.$file)) { 
-		            $bytes += filesize($dir.'/'.$file); 
-		        } else if (is_dir($dir.'/'.$file) && $file != '..' && $file != '.') { 
-		            $bytes += getDirSize($dir.'/'.$file); 
+		    while ($file = readdir($handle)) {
+				$path = $dir."/".$file;
+		        if ($file != '..' && $file != '.' && !is_dir($path)) { 
+		            $bytes += filesize($path); 
+		        } else if (is_dir($path) && $file != '..' && $file != '.') { 
+		            $bytes += getDirSize($path); 
 		        } 
 		    } 
