웹하드 설치좀 해결해주세요 정보
웹하드 설치좀 해결해주세요본문
그림처럼 업로드 다운로드 아이콘이 안나타납니다.
잘은 모르지만 열씸히 했는데도 잘않되네요
해결책좀 알려주세요
사이트 주소는 www.pandory.com/imyou/hard 이고요
소스는 아래와같습니다.
좀 깁니다만 잘몰라 전체를 올렸습니다.
혹시 경로에 문제가있는지요?
그래서 이미지로 서버 경로도 올렸습니다.
좀 구체적인 설명부탁합니다.
index.php 소스
------------------------------------------------------------------------------------------------------------
<?
$g4_path = ".."; // common.php 의 상대 경로
include_once("../bbs/_common.php");
$g4[title] = "웹하드";
include_once("$g4[path]/_head.php"); // 헤더연결
if ($member[mb_level] <= 2) // 웹하드를 사용할수 있는 회원레벨 (현재 레벨3부터 입장가능)
{
$msg = "죄송합니다. 접근할 권한이 없습니다.\\n\\n관리자에게 문의후 이용해 보십시오.";
alert($msg, "$g4[path]");
exit;
}
// 웹하드에서 사용할 넘겨줄 회원 아이디를 변환하며 수정불가
$uid = $member[mb_id];
?>
<table width=755 height=500 cellspacing=0 cellpadding=0 border=0>
<tr>
<td>
</td>
</tr>
<tr>
<td bgcolor=#D6D3CE height=30>
<table width=100% height=100% cellspacing=0 cellpadding=1 border=1>
<tr>
<td width=48% height=30 align=center>
<img src='img/mypc.bmp' border=0 align=absmiddle><font face=Tahoma> <b><? echo $uid;?> 고객님 컴퓨터</b>
</td>
<td width=52% height=30 align=center>
<img src='img/webd.bmp' border=0 align=absmiddle><font face=Tahoma> <b><? echo $uid;?> 고객님 웹하드</b>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height=1 bgcolor=#000000>
</td>
</tr>
<tr>
<td height=500 width=755 bgcolor=#EEEEEE>
<table width=100% height=100% cellspacing=1 cellpadding=0 border=1>
<tr>
<td bgcolor=#eeeeee>
<OBJECT width=755 height=500 ID="CSFManager" CLASSID="CLSID:D4A249DE-A617-11D5-A113-0060082725C0" CODEBASE="fileman.cab#Version=1,1,1,1">
<!--
테스트할 서버의 IP를 기재 하며 대부분 그냥두면됩니다.
-->
<PARAM NAME='Host' Value='<?=$_SERVER[HTTP_HOST]?>'>
<!--
테스트할 서버의 Port를 기재
80 Port일 경우 주석처리...
-->
<PARAM NAME='Port' Value='<?=$SERVER_PORT?>'>
<?
// uid로 회원의 id가 전달되어져 오면 루트디렉토리에 대한 접근은 안되고
// 루트디렉토리 + 회원ID명으로 생성된 디렉토리에 대한 접근만 가능....
if($uid!=""){
// 전체 하드의 폴더를 사용할수 있는 회원레벨을 지정합니다.
// 9라고 넣어면 레벨9와 10은 타회원의 디렉터리를 마음대로 들어갑니다.
if ($member[mb_level] >= 9) {
$smembergrb ="";
} else {
// 일반 회원은 본인의 아이디로 자동 생성된 디렉토리만 접근이 가능합니다.
$smembergrb =$member[mb_id];
}
?>
<PARAM NAME='UID' Value='<? echo $smembergrb;?>'>
<?
}
?>
<!--
파일메니져 컨트롤의 제어를 전담하는 스크립트 파일의 경로를 적는 부분입니다.
아래와 같다면...
<?=str_replace("./","",dirname($_SERVER[PHP_SELF]))?>/fmanager.php 로 접근한다는 내용입니다.
-->
<PARAM NAME='PostAcceptor' Value='<?=str_replace("./","",dirname($_SERVER[PHP_SELF]))?>/fmanager.php'>
</OBJECT>
</td>
</tr>
</table>
</td>
</tr>
</table>
<?
include_once("$g4[path]/_tail.php");
?>
fmanager.php 의 소스
-------------------------------------------------------------------------------------------------------------
<?
function GetFileSize($size){
if($size<1024) return (intval($size) . " Bytes");
else if($size >1024 && $size< 1024 *1024) {
return sprintf("%0.1f KB",$size / 1024);
}else return sprintf("%0.2f MB",$size / (1024*1024));
}
function isHangulString($name){
for($i = 0; $i < strlen($name); $i++) {
if(ord($name[$i]) >= 0x80) {
return 1;
exit;
}
}
return 0;
}
function GetFileExt($sFileName){
if(strpos($sFileName,".")==false) return "";
$aTemp=explode(".",strtolower($sFileName));
$iTemp1=count($aTemp)-1;
return trim($aTemp[$iTemp1]);
}
function DeleteDir($sPath){
$sTempDir=$sPath;
if(is_dir($sTempDir)){
$hDir=opendir($sTempDir);
while($sFileName=readdir($hDir)){
if($sFileName!="." and $sFileName!=".."){
if(is_dir($sTempDir."/".$sFileName)){
DeleteDir($sTempDir."/".$sFileName);
}else{
unlink($sTempDir."/".$sFileName);
}
clearstatcache();
}
}//end of while
closedir($hDir);
rmdir($sPath);
}else{
unlink($sTempDir);
}
}
$SEP_CHAR="*";
$WEBDISK_ROOT_DIR=realpath("./")."/hard/";
$ROOT_DIR=$WEBDISK_ROOT_DIR;
if(trim($uid)!="")$ROOT_DIR.=$uid."/";
if(!(is_dir($ROOT_DIR) )){
mkdir($ROOT_DIR, 0777 );
chmod($ROOT_DIR, 0777 );
// 디렉토리에 있는 파일의 목록을 보이지 않게 한다.
$file = $ROOT_DIR . "/index.php";
$f = @fopen($file, "w");
@fwrite($f, "");
@fclose($f);
@chmod($file, 0606);
}//end of if
if($mode=="")$mode="list";
$mode=strtoupper($mode);
switch($mode){
case "LIST":
$sList="";
if($source=="/")$source="";
$AcessDir=$ROOT_DIR.$source;
$hDir=opendir($AcessDir);
while($sFileName=readdir($hDir)){
$sTempDir=$AcessDir.$sFileName;
if(is_dir($sTempDir)){
$iFileDate=filemtime($sTempDir);
$sFileDate=date("Y-m-d h:i:s",$iFileDate);
if(trim($sFileName)!="." and trim($sFileName)!=".."){
$sList.= $sFileName."/".$SEP_CHAR.$SEP_CHAR.$sFileDate.$SEP_CHAR;
}
}else{
$sFileSize=GetFileSize(filesize($sTempDir));
$iFileDate=filemtime($sTempDir);
$sFileDate=date("Y-m-d h:i:s",$iFileDate);
$sList.= $sFileName.$SEP_CHAR.$sFileSize.$SEP_CHAR.$sFileDate.$SEP_CHAR;
}
clearstatcache();
}//end of while
echo $sList;
clearstatcache();
closedir($hDir);
break;//end of LIST
case "UPLOAD":
if($base=="/")$base="";
if($dir=="/")$dir="";
$AcessDir=$ROOT_DIR.$base;
if($dir!=""){
$sTempDir=$AcessDir;
$aTemp=explode("/",strtolower($dir));
for($i=0;$i<=count($aTemp)-1;$i++){
if(trim($aTemp[$i])!=""){
$sTempDir.=$aTemp[$i];
if(!(is_dir($sTempDir) )){
mkdir($sTempDir, 0777 );
chmod($sTempDir, 0777 );
// 디렉토리에 있는 파일의 목록을 보이지 않게 한다.
$file = $sTempDir . "/index.php";
$f = @fopen($file, "w");
@fwrite($f, "");
@fclose($f);
@chmod($file, 0606);
}//end of if
$sTempDir.="/";
}//end of if
}//end of for
}//end of if
$varname = "UPLOADFILE";
$varname_name = "UPLOADFILE_name";
$varname_type = "UPLOADFILE_type";
$varname_size = "UPLOADFILE_size";
if($$varname == "" || $$varname == "none"){
break;
}
$$varname=str_replace("\\\\","\\", $$varname);
$sFileName1=basename($$varname_name);
/*
//리눅스 코드 (서버가 한글 파일명과 파일명 사이에 공백을 지원하지 않는 운영체제 일 경우...
//Linux에서는 파일명에 공백문자를 지원하지 않으므로 _(언더바)로 대체한다.
$sFileName1=str_replace(" ","_",basename($$varname_name));
//Linux에서는 한글도 안된다.
if(isHangulString($sFileName1)){
$uid = md5(uniqid(rand()));
$sFileName1=$uid.".".GetFileExt(basename($sFileName1));
}
*/
$sTempDir=$AcessDir.$dir.$sFileName1;
copy($$varname,$sTempDir);
break;//end of UPLOAD
case "DOWNLOAD":
if($source=="/")$source="";
$AcessDir=$ROOT_DIR.$source;
$sTempDir=$AcessDir.$filename;
if(is_file($sTempDir)){
header("Content-Type: application/octet-stream;");
Header("Content-Transfer-Encoding: binary");
header("Content-disposition: inline; filename=\"$filename\"");
header("Content-Length: ".filesize($sTempDir));
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT");
header("Pragma: no-cache");
echo readfile($sTempDir);
}
break;//end of DOWNLOAD
case "DELETE":
//mode, source, filename : Query
if($source=="/")$source="";
$AcessDir=$ROOT_DIR.$source;
$sTempDir=$AcessDir.$filename;
DeleteDir($sTempDir);
break;//end of DELETE
case "FILESIZE":
if($source=="/")$source="";
$AcessDir=$ROOT_DIR.$source;
$sTempDir=$AcessDir.$filename;
$i=filesize($sTempDir);
if($i<1)$i=0;
echo $i;
break;//
case "MKDIR":
//mode, base, dir : Query
if($base=="/")$base="";
if($dir=="/")$dir="";
$AcessDir=$ROOT_DIR.$base;
if($dir!=""){
$sTempDir=$AcessDir;
$aTemp=explode("/",strtolower($dir));
for($i=0;$i<=count($aTemp)-1;$i++){
if(trim($aTemp[$i])!=""){
$sTempDir.=$aTemp[$i];
if(!(is_dir($sTempDir) )){
mkdir($sTempDir, 0777 );
chmod($sTempDir, 0777 );
// 디렉토리에 있는 파일의 목록을 보이지 않게 한다.
$file = $sTempDir . "/index.php";
$f = @fopen($file, "w");
@fwrite($f, "");
@fclose($f);
@chmod($file, 0606);
}//end of if
$sTempDir.="/";
}//end of if
}//end of for
}//end of if
break;//end of MKDIR
}//end of switch
?>
-----------------------------------------------------------------
잘은 모르지만 열씸히 했는데도 잘않되네요
해결책좀 알려주세요
사이트 주소는 www.pandory.com/imyou/hard 이고요
소스는 아래와같습니다.
좀 깁니다만 잘몰라 전체를 올렸습니다.
혹시 경로에 문제가있는지요?
그래서 이미지로 서버 경로도 올렸습니다.
좀 구체적인 설명부탁합니다.
index.php 소스
------------------------------------------------------------------------------------------------------------
<?
$g4_path = ".."; // common.php 의 상대 경로
include_once("../bbs/_common.php");
$g4[title] = "웹하드";
include_once("$g4[path]/_head.php"); // 헤더연결
if ($member[mb_level] <= 2) // 웹하드를 사용할수 있는 회원레벨 (현재 레벨3부터 입장가능)
{
$msg = "죄송합니다. 접근할 권한이 없습니다.\\n\\n관리자에게 문의후 이용해 보십시오.";
alert($msg, "$g4[path]");
exit;
}
// 웹하드에서 사용할 넘겨줄 회원 아이디를 변환하며 수정불가
$uid = $member[mb_id];
?>
<table width=755 height=500 cellspacing=0 cellpadding=0 border=0>
<tr>
<td>
</td>
</tr>
<tr>
<td bgcolor=#D6D3CE height=30>
<table width=100% height=100% cellspacing=0 cellpadding=1 border=1>
<tr>
<td width=48% height=30 align=center>
<img src='img/mypc.bmp' border=0 align=absmiddle><font face=Tahoma> <b><? echo $uid;?> 고객님 컴퓨터</b>
</td>
<td width=52% height=30 align=center>
<img src='img/webd.bmp' border=0 align=absmiddle><font face=Tahoma> <b><? echo $uid;?> 고객님 웹하드</b>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height=1 bgcolor=#000000>
</td>
</tr>
<tr>
<td height=500 width=755 bgcolor=#EEEEEE>
<table width=100% height=100% cellspacing=1 cellpadding=0 border=1>
<tr>
<td bgcolor=#eeeeee>
<OBJECT width=755 height=500 ID="CSFManager" CLASSID="CLSID:D4A249DE-A617-11D5-A113-0060082725C0" CODEBASE="fileman.cab#Version=1,1,1,1">
<!--
테스트할 서버의 IP를 기재 하며 대부분 그냥두면됩니다.
-->
<PARAM NAME='Host' Value='<?=$_SERVER[HTTP_HOST]?>'>
<!--
테스트할 서버의 Port를 기재
80 Port일 경우 주석처리...
-->
<PARAM NAME='Port' Value='<?=$SERVER_PORT?>'>
<?
// uid로 회원의 id가 전달되어져 오면 루트디렉토리에 대한 접근은 안되고
// 루트디렉토리 + 회원ID명으로 생성된 디렉토리에 대한 접근만 가능....
if($uid!=""){
// 전체 하드의 폴더를 사용할수 있는 회원레벨을 지정합니다.
// 9라고 넣어면 레벨9와 10은 타회원의 디렉터리를 마음대로 들어갑니다.
if ($member[mb_level] >= 9) {
$smembergrb ="";
} else {
// 일반 회원은 본인의 아이디로 자동 생성된 디렉토리만 접근이 가능합니다.
$smembergrb =$member[mb_id];
}
?>
<PARAM NAME='UID' Value='<? echo $smembergrb;?>'>
<?
}
?>
<!--
파일메니져 컨트롤의 제어를 전담하는 스크립트 파일의 경로를 적는 부분입니다.
아래와 같다면...
<?=str_replace("./","",dirname($_SERVER[PHP_SELF]))?>/fmanager.php 로 접근한다는 내용입니다.
-->
<PARAM NAME='PostAcceptor' Value='<?=str_replace("./","",dirname($_SERVER[PHP_SELF]))?>/fmanager.php'>
</OBJECT>
</td>
</tr>
</table>
</td>
</tr>
</table>
<?
include_once("$g4[path]/_tail.php");
?>
fmanager.php 의 소스
-------------------------------------------------------------------------------------------------------------
<?
function GetFileSize($size){
if($size<1024) return (intval($size) . " Bytes");
else if($size >1024 && $size< 1024 *1024) {
return sprintf("%0.1f KB",$size / 1024);
}else return sprintf("%0.2f MB",$size / (1024*1024));
}
function isHangulString($name){
for($i = 0; $i < strlen($name); $i++) {
if(ord($name[$i]) >= 0x80) {
return 1;
exit;
}
}
return 0;
}
function GetFileExt($sFileName){
if(strpos($sFileName,".")==false) return "";
$aTemp=explode(".",strtolower($sFileName));
$iTemp1=count($aTemp)-1;
return trim($aTemp[$iTemp1]);
}
function DeleteDir($sPath){
$sTempDir=$sPath;
if(is_dir($sTempDir)){
$hDir=opendir($sTempDir);
while($sFileName=readdir($hDir)){
if($sFileName!="." and $sFileName!=".."){
if(is_dir($sTempDir."/".$sFileName)){
DeleteDir($sTempDir."/".$sFileName);
}else{
unlink($sTempDir."/".$sFileName);
}
clearstatcache();
}
}//end of while
closedir($hDir);
rmdir($sPath);
}else{
unlink($sTempDir);
}
}
$SEP_CHAR="*";
$WEBDISK_ROOT_DIR=realpath("./")."/hard/";
$ROOT_DIR=$WEBDISK_ROOT_DIR;
if(trim($uid)!="")$ROOT_DIR.=$uid."/";
if(!(is_dir($ROOT_DIR) )){
mkdir($ROOT_DIR, 0777 );
chmod($ROOT_DIR, 0777 );
// 디렉토리에 있는 파일의 목록을 보이지 않게 한다.
$file = $ROOT_DIR . "/index.php";
$f = @fopen($file, "w");
@fwrite($f, "");
@fclose($f);
@chmod($file, 0606);
}//end of if
if($mode=="")$mode="list";
$mode=strtoupper($mode);
switch($mode){
case "LIST":
$sList="";
if($source=="/")$source="";
$AcessDir=$ROOT_DIR.$source;
$hDir=opendir($AcessDir);
while($sFileName=readdir($hDir)){
$sTempDir=$AcessDir.$sFileName;
if(is_dir($sTempDir)){
$iFileDate=filemtime($sTempDir);
$sFileDate=date("Y-m-d h:i:s",$iFileDate);
if(trim($sFileName)!="." and trim($sFileName)!=".."){
$sList.= $sFileName."/".$SEP_CHAR.$SEP_CHAR.$sFileDate.$SEP_CHAR;
}
}else{
$sFileSize=GetFileSize(filesize($sTempDir));
$iFileDate=filemtime($sTempDir);
$sFileDate=date("Y-m-d h:i:s",$iFileDate);
$sList.= $sFileName.$SEP_CHAR.$sFileSize.$SEP_CHAR.$sFileDate.$SEP_CHAR;
}
clearstatcache();
}//end of while
echo $sList;
clearstatcache();
closedir($hDir);
break;//end of LIST
case "UPLOAD":
if($base=="/")$base="";
if($dir=="/")$dir="";
$AcessDir=$ROOT_DIR.$base;
if($dir!=""){
$sTempDir=$AcessDir;
$aTemp=explode("/",strtolower($dir));
for($i=0;$i<=count($aTemp)-1;$i++){
if(trim($aTemp[$i])!=""){
$sTempDir.=$aTemp[$i];
if(!(is_dir($sTempDir) )){
mkdir($sTempDir, 0777 );
chmod($sTempDir, 0777 );
// 디렉토리에 있는 파일의 목록을 보이지 않게 한다.
$file = $sTempDir . "/index.php";
$f = @fopen($file, "w");
@fwrite($f, "");
@fclose($f);
@chmod($file, 0606);
}//end of if
$sTempDir.="/";
}//end of if
}//end of for
}//end of if
$varname = "UPLOADFILE";
$varname_name = "UPLOADFILE_name";
$varname_type = "UPLOADFILE_type";
$varname_size = "UPLOADFILE_size";
if($$varname == "" || $$varname == "none"){
break;
}
$$varname=str_replace("\\\\","\\", $$varname);
$sFileName1=basename($$varname_name);
/*
//리눅스 코드 (서버가 한글 파일명과 파일명 사이에 공백을 지원하지 않는 운영체제 일 경우...
//Linux에서는 파일명에 공백문자를 지원하지 않으므로 _(언더바)로 대체한다.
$sFileName1=str_replace(" ","_",basename($$varname_name));
//Linux에서는 한글도 안된다.
if(isHangulString($sFileName1)){
$uid = md5(uniqid(rand()));
$sFileName1=$uid.".".GetFileExt(basename($sFileName1));
}
*/
$sTempDir=$AcessDir.$dir.$sFileName1;
copy($$varname,$sTempDir);
break;//end of UPLOAD
case "DOWNLOAD":
if($source=="/")$source="";
$AcessDir=$ROOT_DIR.$source;
$sTempDir=$AcessDir.$filename;
if(is_file($sTempDir)){
header("Content-Type: application/octet-stream;");
Header("Content-Transfer-Encoding: binary");
header("Content-disposition: inline; filename=\"$filename\"");
header("Content-Length: ".filesize($sTempDir));
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT");
header("Pragma: no-cache");
echo readfile($sTempDir);
}
break;//end of DOWNLOAD
case "DELETE":
//mode, source, filename : Query
if($source=="/")$source="";
$AcessDir=$ROOT_DIR.$source;
$sTempDir=$AcessDir.$filename;
DeleteDir($sTempDir);
break;//end of DELETE
case "FILESIZE":
if($source=="/")$source="";
$AcessDir=$ROOT_DIR.$source;
$sTempDir=$AcessDir.$filename;
$i=filesize($sTempDir);
if($i<1)$i=0;
echo $i;
break;//
case "MKDIR":
//mode, base, dir : Query
if($base=="/")$base="";
if($dir=="/")$dir="";
$AcessDir=$ROOT_DIR.$base;
if($dir!=""){
$sTempDir=$AcessDir;
$aTemp=explode("/",strtolower($dir));
for($i=0;$i<=count($aTemp)-1;$i++){
if(trim($aTemp[$i])!=""){
$sTempDir.=$aTemp[$i];
if(!(is_dir($sTempDir) )){
mkdir($sTempDir, 0777 );
chmod($sTempDir, 0777 );
// 디렉토리에 있는 파일의 목록을 보이지 않게 한다.
$file = $sTempDir . "/index.php";
$f = @fopen($file, "w");
@fwrite($f, "");
@fclose($f);
@chmod($file, 0606);
}//end of if
$sTempDir.="/";
}//end of if
}//end of for
}//end of if
break;//end of MKDIR
}//end of switch
?>
-----------------------------------------------------------------
댓글 전체