묻고답하기

test#test.zip 이라는 파일이 지워지질 않네요
계속 아래의 오류 메세지가 출력이 됩니다.

Warning: unlink() failed (No such file or directory) in /home/Freehosting/heosang/www/test/dp.php on line 123


아래는 에러가 나는 123번 부근입니다.

        elseif($delete) // if the delete button was pressed
        {
                // delete the file
                unlink($path.$delete);  =====>123번 라인입니다.
        }



테스트 하실분은 아래 링크를 눌러주세요
http://hosting.bcpark.net/~heosang/test/dp.php
여기에는 중요한 파일 없으니까 마음껏 지우시고, 테스트 해보셔도 됩니다.
php소스를 다운받아 보시고 싶으신 분은 아래것을 받으세요
http://hosting.bcpark.net/~heosang/dp.zip

=============아래는 QTO File Manager의 소스입니다.===============================
<?php
/* QTOFileManagerLite 1.0
*
*Copyright (C) 2001 Quentin O'Sullivan <quentin@qto.com> All rights reserved.
*Web Site: http://www.qto.com/fm
*
*This program is free software; you can redistribute it and/or
*modify it under the terms of the GNU General Public License
*as published by the Free Software Foundation; either version 2
*of the License, or (at your option) any later version.
*
*This program is distributed in the hope that it will be useful,
*but WITHOUT ANY WARRANTY; without even the implied warranty of
*MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*GNU General Public License for more details.
*
*You should have received a copy of the GNU General Public License
*along with this program; if not, write to the Free Software
*Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
************************************************************************
*/

// set these configuration variables
$user = "";  // change this to the username you would like to use. leave it empty if you dont want to use authentication
$pass = "";
$MaxFileSize = "20000000"; // max file size in bytes
$HDDSpace = "100000000"; // max total size of all files in directory
$HiddenFiles = array(".htaccess"); // add any file names to this array which should remain invisible
$EditOn = 1; // make this = 0 if you dont want the to use the edit function at all
$EditExtensions = array("htm","html","txt"); // add the extensions of file types that you would like to be able to edit

/********************************************************************/

$ThisFileName = basename(__FILE__); // get the file name
$path = str_replace($ThisFileName,"",__FILE__);   // get the directory path

if($login)
{
        if(!($u == $user && $password == $pass))
        {
                $msg = "<font face='Verdana, Arial, Hevetica' size='2' color='#ff0000'>The login details were incorrect</font><br><br>";
                $loginfailed = 1;
        }
}


if(($user == $u || $user == "") && $edit) // if an edit link was clicked
{
        $fp = fopen($path.$edit, "r");
        $oldcontent = fread($fp, filesize($path.$edit));
        fclose($fp);
        
$filemanager = <<<content
        <center>
        <table border="0" cellspacing="0" cellpadding="20" bgcolor="#eeeeee">
        <tr>
        <td>
        <font face="Verdana, Arial, Hevetica" size="4" color="#333333"><b>FILE MANAGER</b></font><br>
        <form name="form1" method="post" action="$PHP_SELF">
          <center>
            <textarea name="newcontent" cols="35" rows="15">$oldcontent</textarea>
            <br>
          <br>
            <input type="submit" name="save" value="Save">
            <input type="submit" name="cancel" value="Cancel">
                        <input type="hidden" name="u" value="$u">
                        <input type="hidden" name="savefile" value="$edit">
          </center>
        </form>
        </td>
        </tr>
        </table>
        </center>
content;
        
}
elseif(($user == $u || $user == "") && !$loginfailed)
{
                
        if($save) // if the save button was pressed on the edit screen
        {
                $newcontent = stripslashes($newcontent);
                $fp = fopen($path.$savefile, "w");
                fwrite($fp, $newcontent);
                fclose($fp);
        }

        $HDDTotal = dirsize($path); // get the total size of all files in the directory including any sub directorys

        if ($upload) // if the upload button was pressed
        {
                if($HTTP_POST_FILES['uploadedfile']['name']) // if a file was actually uploaded
                {
                        $HTTP_POST_FILES['uploadedfile']['name'] = str_replace("%","",$HTTP_POST_FILES['uploadedfile']['name']);  // remove any % signs from the file name
                        // if the file size is within allowed limits
                        if($HTTP_POST_FILES['uploadedfile']['size'] > 0 && $HTTP_POST_FILES['uploadedfile']['size'] < $MaxFileSize)
                        {
                                // if adding the file will not exceed the maximum allowed total
                                if(($HDDTotal + $HTTP_POST_FILES['uploadedfile']['size']) < $HDDSpace)
                                {
                                        // put the file in the directory
                                        move_uploaded_file($HTTP_POST_FILES['+ '+ 'uploadedfile']['tmp_name'], $path.$HTTP_POST_FILES['uploadedfile'+ ']['name']);        
                                }
                                else
                                {
                                         $msg = "<font face='Verdana, Arial, Hevetica' size='2' color='#ff0000'>There is not enough free space and the file could<br>not be uploaded.</font><br>";
                                }
                        }
                        else
                        {
                                $MaxKB = $MaxFileSize/1000; // show the max file size in Kb
                                $msg =  "<font face='Verdana, Arial, Hevetica' size='2' color='#ff0000'>The file was greater than the maximum allowed<br>file size of $MaxKB Kb and could not be uploaded.</font><br>";
                        }
                }
                else
                {
                        $msg =  "<font face='Verdana, Arial, Hevetica' size='2' color='#ff0000'>Please press the browse button and select a file<br>to upload before you press the upload button.</font><br>";
                }
        }
        elseif($delete) // if the delete button was pressed
        {
                // delete the file
                unlink($path.$delete);
        }

        $HDDTotal = dirsize($path); // get the total size of all files in the directory including any sub directorys
        $freespace = ($HDDSpace - $HDDTotal)/1000; // work out how much free space is left
        $HDDTotal = (int) ($HDDTotal/1000); // convert to Kb instead of bytes and type cast it as an int
        $freespace = (int) $freespace; // type cast as an int
        $HDDSpace = (int) ($HDDSpace/1000); // convert to Kb instead of bytes and type cast it as an int
        $MaxFileSizeKb = (int) ($MaxFileSize/1000); // convert to Kb instead of bytes and type cast it as an int

        // build the html that makes up the file manager
        // the $filemanager variable holds the first part of the html
        // including the form tags and the top 2 heading rows of the table which
        // dont display files
        $filemanager = <<<content
        <center>
        <table border='0' cellspacing='0' cellpadding='20'>
        <tr>
        <td>
        $msg
        <font face="Verdana, Arial, Hevetica" size="2">
                <b>Total Space:</b> $HDDSpace Kb<br>
                <b>Max File Size:</b> $MaxFileSizeKb Kb<br>
                <b>Free Space:</b> $freespace Kb<br>
                <b>Used Space:</b> $HDDTotal Kb</font>
        <form name="form1" method="post" action="$PHP_SELF" enctype="multipart/form-data">
        <input type="hidden" name="MAX_FILE_SIZE" value="$MaxFileSize">
          <input type="file" name="uploadedfile">
          <input type="submit" name="upload" value="Upload">
          <input type="hidden" name="u" value="$u">
        </form>
        <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr>
        <td height="20" bgcolor="#333333"></td>
        <td bgcolor="#333333" height="20"><font face="Verdana, Arial, Helvetica" size="2" color="#FFFFFF"><b> FILENAME </b></font></td>
        <td height="20" bgcolor="#333333"><font color="#FFFFFF" size="2" face="Verdana, Arial, Helvetica"><b> SIZE (bytes) </b></font></td>
        <td height="20" bgcolor="#333333"></td>
        <td height="20" bgcolor="#333333"></td>
        </tr>
        <tr>
        <td height="2" bgcolor="#999999"></td>
        <td height="2" bgcolor="#999999"></td>
        <td height="2" bgcolor="#999999"></td>
        <td height="2" bgcolor="#999999"></td>
        <td height="2" bgcolor="#999999"></td>
        </tr>
content;

        // build the table rows which contain the file information
        $newpath = substr($path, 0, -1);   // remove the forward or backwards slash from the path
        $dir = @opendir($newpath); // open the directory
        while($file = readdir($dir)) // loop once for each name in the directory
        {
                // if the name is not a directory and the name is not the name of this program file
                if(is_file($path.$file) && $file != "$ThisFileName")
                {
                        $match = 0;
                        foreach($HiddenFiles as $name) // for each value in the hidden files array
                        {
                                if($file == $name) // check the name is not the same as the hidden file name
                                {        
                                        $match = 1;         // set a flag if this name is supposed to be hidden
                                }
                        }        
                        if(!$match) // if there were no matches the file should not be hidden
                        {        
                                        $filedata = stat($file); // get some info about the file
                                        
                                        // find out if the file is one that can be edited
                                        $editlink =         "";
                                        if($EditOn)  // if the edit function is turned on
                                        {
                                                $dotpos = strrpos($file, ".");
                                                foreach($EditExtensions as $editext)
                                                {
                                                        $ext = substr($file, ($dotpos+1));
                                                        if(strcmp($ext, $editext) == 0)
                                                        {
                                                                $editlink =         " <a href='$PHP_SELF?edit=$file&u=$u'><font face='+ 'Verdana, Arial, Helvetica' size='2' color='#666666'>EDIT</font></a> ";
                                                        }
                                                }
                                        }
                                        
                                        // append 2 table rows to the $content variable, the first row has the file
                                        // informtation, the 2nd row makes a black line 1 pixel high
                                        $content .= <<<content
                                        <tr>
                                        <td bgcolor="#FFFFFF"></td>
                                        <td> <font face="Verdana, Arial, Helvetica" size="2"><a href=$file>$file</a></font> </td>
                                        <td bgcolor="#FFFFFF"> <font face="Verdana, Arial, Helvetica" size="2">$filedata[7]</font> </td>
                                        <td> <a href='$PHP_SELF?delete=$file&u=$u'><font face="Verdana, Arial, Helvetica" size="2" color="#666666">DELETE</font></a> </td>
                                        <td bgcolor="#FFFFFF">$editlink</td>
                                        </tr>
                                        <tr>
                                        <td height="1" bgcolor="#000000"></td>
                                        <td height="1" bgcolor="#000000"></td>
                                        <td height="1" bgcolor="#000000"></td>
                                        <td height="1" bgcolor="#000000"></td>
                                        <td height="1" bgcolor="#000000"></td>
                                        </tr>        
content;
                        }
                }
        }
        closedir($dir); // now that all the rows have been built close the directory
        $content .= "</td></tr></table></table></center>"; // add some closing tags to the $content variable
        $filemanager  .= $content; // append the html to the $filemanager variable

}
else
{
        $filemanager = <<<content
        <center>
        <table border='0' cellspacing='0' cellpadding='20' bgcolor='#eeeeee'>
        <tr>
        <td>
        <font face="Verdana, Arial, Hevetica" size="4" color="#333333"><b>FILE MANAGER</b></font><br>
        <form name="form1" method="post" action="$PHP_SELF">
        $msg
        <center>
        <font face="Verdana, Arial, Hevetica" size="2">User Name:</font><input type="text" name="u"><br>
          <font face="Verdana, Arial, Hevetica" size="2">Password:</font><input type="password" name="password"><br>
          <input type="submit" name="login" value="Login">
          </center>
        </form>
        </td>
        </tr>
        </table>
        </center>
content;
}

function dirsize($dir)
// calculate the size of files in $dir
{
        $dh = opendir($dir);
        $size = 0;
        while (($file = readdir($dh)) !== false)
        {
                if ($file != "." and $file != "..")
                {
                        $path = $dir.$file;
                        if (is_file($path))
                        {
                                $size += filesize($path);
                        }
                }
        }
        closedir($dh);
        return $size;
}

?>


<html>
<head>
<title>DivX Patch</title>
<style type="text/css">
<!--
A:link {text-decoration:none}
A:visited {text-decoration:none}
A:active {text-decoration:none}
A:hover {text-decoration:none}
-->
</style>
</head>
<body oncontextmenu="return false" onSelectStart="window.event.cancelBubble=true;" >
<?php echo $filemanager ?>
</body>
</html>
글쓴이 제목 최종 글
XE 공지 글 쓰기,삭제 운영방식 변경 공지 [16] 2019.03.05 by 남기남
Illution 폰트 있잖아요. 굴림 폰트를 이미지로 할때 그냥 글씨를 쓴것처럼 하려면.. [1] 2007.08.10
Stylist™ 폰트관련 질문입니다. [2] 2007.08.10
고한종 프레임나누는 방법을 이용해서 주소고정을 했는데요 [1] 2007.08.10
PlAyA 테이블 다시 질문합니다.. [1] 2007.08.10
장석권 다시 질문좀 드리겠습니다. [3] 2007.08.10
즐거운하루 도메인 아래 모든 파일을 특정도메인으로 포워딩  
즐거운하루 도메인 아래 모든 파일을 특정도메인으로 포워딩 [2] 2007.08.10
코코푸르나 동영상의 화면크기를 어떻게 제어할까요? [2] 2007.08.10
『L4L7Kary』 표안에 글을 삽입햇는데 안나옵니다.. [3] 2007.08.10
PlAyA 테이블을 처음에 만들면.. [1] 2007.08.10
박형준 네비게이션 조작에 관해서... [1] 2007.08.10
DearMai 아차피 서버에 대해 ;ㅁ; [4] 2007.08.10
phase 웹 파일매니저사용중 # 문자가 들어간 파일이 지워지질 않습니다. [2] 2007.08.10
barami popup창 한번만 띄우기.. ㅡ.ㅡ; [2] 2007.08.10
진입명 포워딩과 무슨 dns 복제에 관한 질문인데요. [3] 2007.08.10
윤 만식 php에서 사용자가 내용을 입력한후 그 사실을 메일로 알리려고 합니다만.. [2] 2007.08.10
서성원 php 연산에서요.. [1] 2007.08.10
안영미 죄송합니다. 다시 질문합니다. 플래시와 게시판.. [1] 2007.08.10
풍월주인 [re] 죄송합니다. 다시 질문합니다. 플래시와 게시판.. [3] 2007.08.10
유성국 phpmyadmin 질문 [2] 2007.08.10
박상현 이미지가 왜케 구리게 나오죠 [4] 2007.08.10
데빈타운젠드 여기에 쓰인폰트가 무슨 폰트죠 ㅡ_ㅡ? 알려주세영^^ [3] 2007.08.10
Masta_K 벅스뮤직의 리스트셀관련 질문입니다. [1] 2007.08.10
박세영 이렇게 어떻게 만들어요?? 포토샵인가요? [2] 2007.08.10
장석권 질문좀 드리겠습니다. 프레임 안에 게시판 넣을때요.. [1] 2007.08.10
김두수 db에 접근이 거절 [1] 2007.08.10
phase 무료 프로그램중에 다운로드하게 해주는 프로그램은 없나요? [3] 2007.08.10
♣모야이넘은♣ 노프레임으루.. [1] 2007.08.10
『L4L7Kary』 3가지 질문!! 표잘만지시는분 보셔요! [3] 2007.08.10
[-_-]경자 이상한 버그 같은게 생겼는데요. -_- [2] 2007.08.10