Index: temp/trunk/html/test/uehara/tree.php
===================================================================
--- temp/trunk/html/test/uehara/tree.php	(revision 8628)
+++ temp/trunk/html/test/uehara/tree.php	(revision 8630)
@@ -48,11 +48,6 @@
 			$objPage->tpl_javascript = "alert('¢¨¡¡¥Ç¥£¥ì¥¯¥È¥ê¤ò¥À¥¦¥ó¥í¡¼¥É¤¹¤ë¤³¤È¤Ï½ÐÍè¤Þ¤»¤ó¡£');";
 		} else {
-			// ¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¤Ï¥À¥¦¥ó¥í¡¼¥É¤µ¤»¤ë
-			Header("Content-disposition: attachment; filename=".basename($_POST['select_file']));
-			Header("Content-type: application/octet-stream; name=".basename($_POST['select_file']));
-			Header("Cache-Control: ");
-			Header("Pragma: ");
-			echo (lfReadFile($_POST['select_file']));
-			
+			// ¥Õ¥¡¥¤¥ë¥À¥¦¥ó¥í¡¼¥É
+			lfDownloadFile($_POST['select_file']);
 			exit;			
 		}
@@ -80,67 +75,4 @@
 
 /* 
- * ´Ø¿ôÌ¾¡§lfGetFileList()
- * ÀâÌÀ¡¡¡§»ØÄê¥Ñ¥¹ÇÛ²¼¤Î¥Ç¥£¥ì¥¯¥È¥ê¼èÆÀ
- * °ú¿ô1 ¡§¥Ä¥ê¡¼¤ò³ÊÇ¼ÇÛÎó
- * °ú¿ô2 ¡§¼èÆÀ¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¥Ñ¥¹
- */
-function lfGetFileList($dir) {
-	$arrFileList = array();
-	if (is_dir($dir)) {
-		if ($dh = opendir($dir)) { 
-			$cnt = 0;
-			while (($file = readdir($dh)) !== false) { 
-				// ./ ¤È ../¤ò½ü¤¯¥Õ¥¡¥¤¥ë¤Î¤ß¤ò¼èÆÀ
-				if($file != "." && $file != "..") {
-					// ¹ÔËö¤Î/¤ò¼è¤ê½ü¤¯
-					$dir = ereg_replace("\/$", "", $dir);
-					$path = $dir."/".$file;
-					$arrFileList[$cnt]['file_name'] = $file;
-					$arrFileList[$cnt]['file_path'] = $path;
-					$arrFileList[$cnt]['file_size'] = getDirSize($path);
-					$arrFileList[$cnt]['file_time'] = date("Y/m/d", filemtime($path)); 
-					$cnt++;
-				}
-	        }
-	        closedir($dh); 
-	    }
-	} 
-	
-	return $arrFileList;
-}
-
-/* 
- * ´Ø¿ôÌ¾¡§getDirSize()
- * ÀâÌÀ¡¡¡§»ØÄê¤·¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Î¥Ð¥¤¥È¿ô¤ò¼èÆÀ
- * °ú¿ô1 ¡§¥Õ¥¡¥¤¥ë³ÊÇ¼ÇÛÎó
- */
-function getDirSize($dir) {
-	if(file_exists($dir)) {
-		// ¥Ç¥£¥ì¥¯¥È¥ê¤Î¾ì¹ç²¼ÁØ¥Õ¥¡¥¤¥ë¤ÎÁíÎÌ¤ò¼èÆÀ
-		if (is_dir($dir)) {
-		    $handle = opendir($dir); 
-		    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); 
-		        } 
-		    } 
-		} else {
-			// ¥Õ¥¡¥¤¥ë¤Î¾ì¹ç
-			$bytes = filesize($dir);
-		}
-	} else {
-		// ¥Ç¥£¥ì¥¯¥È¥ê¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¤Ï0byte¤òÊÖ¤¹
-		$bytes = 0;
-	}
-	
-	if($bytes == "") $bytes = 0;
-	
-    return $bytes; 
-} 
-
-/* 
  * ´Ø¿ôÌ¾¡§lfErrorCheck()
  * ÀâÌÀ¡¡¡§¥¨¥é¡¼¥Á¥§¥Ã¥¯
@@ -154,19 +86,3 @@
 }
 
-/* 
- * ´Ø¿ôÌ¾¡§lfReadFile()
- * °ú¿ô1 ¡§¥Õ¥¡¥¤¥ë¥Ñ¥¹
- * ÀâÌÀ¡¡¡§¥Õ¥¡¥¤¥ëÆÉ¹þ
- */
-function lfReadFile($filename) { 
-    $str = ""; 
-    // ¥Ð¥¤¥Ê¥ê¥â¡¼¥É¤Ç¥ª¡¼¥×¥ó 
-    $fp = @fopen($filename, "rb" ); 
-    //¥Õ¥¡¥¤¥ëÆâÍÆ¤òÁ´¤ÆÊÑ¿ô¤ËÆÉ¤ß¹þ¤à 
-    if($fp) { 
-        $str = @fread($fp, filesize($filename)+1); 
-    } 
-    @fclose($fp); 
-    return $str; 
-} 
 ?>
Index: temp/trunk/html/test/uehara/file_view.php
===================================================================
--- temp/trunk/html/test/uehara/file_view.php	(revision 8625)
+++ temp/trunk/html/test/uehara/file_view.php	(revision 8630)
@@ -11,24 +11,6 @@
 // ¥Õ¥¡¥¤¥ëÆâÍÆÉ½¼¨
 print("<pre>\n");
-print(lfReadFile(USER_PATH.$_GET['file']));
+print(nl2br(lfReadFile(USER_PATH.$_GET['file'])));
 print("</pre>\n");
 
-/* 
- * ´Ø¿ôÌ¾¡§lfReadFile()
- * °ú¿ô1 ¡§¥Õ¥¡¥¤¥ë¥Ñ¥¹
- * ÀâÌÀ¡¡¡§¥Õ¥¡¥¤¥ëÆÉ¹þ
- */
-function lfReadFile($filename) { 
-    $str = ""; 
-    // ¥Ð¥¤¥Ê¥ê¥â¡¼¥É¤Ç¥ª¡¼¥×¥ó 
-    $fp = @fopen($filename, "rb" ); 
-    //¥Õ¥¡¥¤¥ëÆâÍÆ¤òÁ´¤ÆÊÑ¿ô¤ËÆÉ¤ß¹þ¤à 
-    if($fp) { 
-        $str = @fread($fp, filesize($filename)+1); 
-    } 
-    @fclose($fp); 
-    // ²þ¹Ô¥³¡¼¥É¤ÎÁ°¤Ë<br />¤òÁÞÆþ 
-    $str = nl2br($str); 
-    return $str; 
-} 
 ?>
Index: temp/trunk/html/require.php
===================================================================
--- temp/trunk/html/require.php	(revision 7199)
+++ temp/trunk/html/require.php	(revision 8630)
@@ -31,4 +31,5 @@
 require_once($include_dir . "/../data/class/SC_Pdf.php");
 require_once($include_dir . "/../data/include/page_layout.inc");
+require_once($include_dir . "/../data/include/file_manager.inc");
 
 // ¥¢¥Ã¥×¥Ç¡¼¥È¤Ç¼èÆÀ¤·¤¿PHP¤òÆÉ¤ß½Ð¤¹
