Changeset 8630 for temp/trunk/html


Ignore:
Timestamp:
2006/11/19 21:07:17 (20 years ago)
Author:
uehara
Message:

blank

Location:
temp/trunk/html
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • temp/trunk/html/require.php

    r7199 r8630  
    3131require_once($include_dir . "/../data/class/SC_Pdf.php"); 
    3232require_once($include_dir . "/../data/include/page_layout.inc"); 
     33require_once($include_dir . "/../data/include/file_manager.inc"); 
    3334 
    3435// ¥¢¥Ã¥×¥Ç¡¼¥È¤Ç¼èÆÀ¤·¤¿PHP¤òÆÉ¤ß½Ð¤¹ 
  • temp/trunk/html/test/uehara/file_view.php

    r8625 r8630  
    1111// ¥Õ¥¡¥¤¥ëÆâÍÆÉ½¼¨ 
    1212print("<pre>\n"); 
    13 print(lfReadFile(USER_PATH.$_GET['file'])); 
     13print(nl2br(lfReadFile(USER_PATH.$_GET['file']))); 
    1414print("</pre>\n"); 
    1515 
    16 /*  
    17  * ´Ø¿ô̾¡§lfReadFile() 
    18  * °ú¿ô1 ¡§¥Õ¥¡¥¤¥ë¥Ñ¥¹ 
    19  * ÀâÌÀ¡¡¡§¥Õ¥¡¥¤¥ëÆÉ¹þ 
    20  */ 
    21 function lfReadFile($filename) {  
    22     $str = "";  
    23     // ¥Ð¥¤¥Ê¥ê¥â¡¼¥É¤Ç¥ª¡¼¥×¥ó  
    24     $fp = @fopen($filename, "rb" );  
    25     //¥Õ¥¡¥¤¥ëÆâÍÆ¤òÁ´¤ÆÊÑ¿ô¤ËÆÉ¤ß¹þ¤à  
    26     if($fp) {  
    27         $str = @fread($fp, filesize($filename)+1);  
    28     }  
    29     @fclose($fp);  
    30     // ²þ¹Ô¥³¡¼¥É¤ÎÁ°¤Ë<br />¤òÁÞÆþ  
    31     $str = nl2br($str);  
    32     return $str;  
    33 }  
    3416?> 
  • temp/trunk/html/test/uehara/tree.php

    r8628 r8630  
    4848            $objPage->tpl_javascript = "alert('¢¨¡¡¥Ç¥£¥ì¥¯¥È¥ê¤ò¥À¥¦¥ó¥í¡¼¥É¤¹¤ë¤³¤È¤Ï½ÐÍè¤Þ¤»¤ó¡£');"; 
    4949        } else { 
    50             // ¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¤Ï¥À¥¦¥ó¥í¡¼¥É¤µ¤»¤ë 
    51             Header("Content-disposition: attachment; filename=".basename($_POST['select_file'])); 
    52             Header("Content-type: application/octet-stream; name=".basename($_POST['select_file'])); 
    53             Header("Cache-Control: "); 
    54             Header("Pragma: "); 
    55             echo (lfReadFile($_POST['select_file'])); 
    56              
     50            // ¥Õ¥¡¥¤¥ë¥À¥¦¥ó¥í¡¼¥É 
     51            lfDownloadFile($_POST['select_file']); 
    5752            exit;            
    5853        } 
     
    8075 
    8176/*  
    82  * ´Ø¿ô̾¡§lfGetFileList() 
    83  * ÀâÌÀ¡¡¡§»ØÄê¥Ñ¥¹ÇÛ²¼¤Î¥Ç¥£¥ì¥¯¥È¥ê¼èÆÀ 
    84  * °ú¿ô1 ¡§¥Ä¥ê¡¼¤ò³ÊǼÇÛÎó 
    85  * °ú¿ô2 ¡§¼èÆÀ¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¥Ñ¥¹ 
    86  */ 
    87 function lfGetFileList($dir) { 
    88     $arrFileList = array(); 
    89     if (is_dir($dir)) { 
    90         if ($dh = opendir($dir)) {  
    91             $cnt = 0; 
    92             while (($file = readdir($dh)) !== false) {  
    93                 // ./ ¤È ../¤ò½ü¤¯¥Õ¥¡¥¤¥ë¤Î¤ß¤ò¼èÆÀ 
    94                 if($file != "." && $file != "..") { 
    95                     // ¹ÔËö¤Î/¤ò¼è¤ê½ü¤¯ 
    96                     $dir = ereg_replace("\/$", "", $dir); 
    97                     $path = $dir."/".$file; 
    98                     $arrFileList[$cnt]['file_name'] = $file; 
    99                     $arrFileList[$cnt]['file_path'] = $path; 
    100                     $arrFileList[$cnt]['file_size'] = getDirSize($path); 
    101                     $arrFileList[$cnt]['file_time'] = date("Y/m/d", filemtime($path));  
    102                     $cnt++; 
    103                 } 
    104             } 
    105             closedir($dh);  
    106         } 
    107     }  
    108      
    109     return $arrFileList; 
    110 } 
    111  
    112 /*  
    113  * ´Ø¿ô̾¡§getDirSize() 
    114  * ÀâÌÀ¡¡¡§»ØÄꤷ¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Î¥Ð¥¤¥È¿ô¤ò¼èÆÀ 
    115  * °ú¿ô1 ¡§¥Õ¥¡¥¤¥ë³ÊǼÇÛÎó 
    116  */ 
    117 function getDirSize($dir) { 
    118     if(file_exists($dir)) { 
    119         // ¥Ç¥£¥ì¥¯¥È¥ê¤Î¾ì¹ç²¼ÁØ¥Õ¥¡¥¤¥ë¤ÎÁíÎ̤ò¼èÆÀ 
    120         if (is_dir($dir)) { 
    121             $handle = opendir($dir);  
    122             while ($file = readdir($handle)) { 
    123                 $path = $dir."/".$file; 
    124                 if ($file != '..' && $file != '.' && !is_dir($path)) {  
    125                     $bytes += filesize($path);  
    126                 } else if (is_dir($path) && $file != '..' && $file != '.') {  
    127                     $bytes += getDirSize($path);  
    128                 }  
    129             }  
    130         } else { 
    131             // ¥Õ¥¡¥¤¥ë¤Î¾ì¹ç 
    132             $bytes = filesize($dir); 
    133         } 
    134     } else { 
    135         // ¥Ç¥£¥ì¥¯¥È¥ê¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¤Ï0byte¤òÊÖ¤¹ 
    136         $bytes = 0; 
    137     } 
    138      
    139     if($bytes == "") $bytes = 0; 
    140      
    141     return $bytes;  
    142 }  
    143  
    144 /*  
    14577 * ´Ø¿ô̾¡§lfErrorCheck() 
    14678 * ÀâÌÀ¡¡¡§¥¨¥é¡¼¥Á¥§¥Ã¥¯ 
     
    15486} 
    15587 
    156 /*  
    157  * ´Ø¿ô̾¡§lfReadFile() 
    158  * °ú¿ô1 ¡§¥Õ¥¡¥¤¥ë¥Ñ¥¹ 
    159  * ÀâÌÀ¡¡¡§¥Õ¥¡¥¤¥ëÆÉ¹þ 
    160  */ 
    161 function lfReadFile($filename) {  
    162     $str = "";  
    163     // ¥Ð¥¤¥Ê¥ê¥â¡¼¥É¤Ç¥ª¡¼¥×¥ó  
    164     $fp = @fopen($filename, "rb" );  
    165     //¥Õ¥¡¥¤¥ëÆâÍÆ¤òÁ´¤ÆÊÑ¿ô¤ËÆÉ¤ß¹þ¤à  
    166     if($fp) {  
    167         $str = @fread($fp, filesize($filename)+1);  
    168     }  
    169     @fclose($fp);  
    170     return $str;  
    171 }  
    17288?> 
Note: See TracChangeset for help on using the changeset viewer.