공대 여자님... 업로드 기능이 말을 안듣네요...

1

원인이 뭔지는 모르겟으나, 업로드 기능이 작동을 안해요 ㅠㅠ

@move_uploaded_file($_FILES['file']['tmp_name'], $dest);

기능이 안되서,

copy ($_FILES['file']['tmp_name'], $dest);

함수를 써보고 해도 안되네요... 뭔가 문제인지 지적좀^^;

 

=== 전체 소스

<?

if(!is_dir("_upload/")) {
@mkdir("_upload/",0777);
@chmod("_upload/",0777);
@mkdir($fid, 0777);
@mkdir($fid."/_upload", 0777);
return;
}
//업로드 공간폴더
$did = $fid."/_upload/";
$dest = $fid."/_upload/";

//파일 업로드 함수.
if($_FILES[file]){
$fme = $_FILES['file']['name']; //파일 네임 함수.
$ext = strtolower(substr($fme,-4));
$dest = $did.str_replace("%","",urlencode($fme)); //통과
if(is_uploaded_file($dest)){echo "<script>alert('정상적으로 접근하시길 바랍니다.');</script>";exit;}
copy ($_FILES['file']['tmp_name'], $dest);
$fme="/_upload/".$fme;
@chmod($fme,0706);
if(!is_uploaded_file($dest)){echo "<script>alert('업로드에 실패하였습니다! ->원인 : 퍼미션을 확인하거나, 디렉터리(폴더)존재 여부를 확인하세요!');</script>";exit;}
$fmee = str_replace("%","^",urlencode($fme));

if($ext=='.jpg' || $ext=='.gif' || $ext=='.png' || $ext=='.bmp'){
$c = "<a href='#none' onclick='imgview(\"{$fmee}\")' style='color:red'>{$fme}</a>";
} else {
$c = "<a target='_blank' href='{$chat}?id={$id}&down={$fmee}' style='color:red'>{$fme}</a>";
}
$c= $n."\x1b".c."\x1b"."(.date('Y-m-d H:i:s').') \n')";
//writee($n,$c);

if($_GET[view]||$_GET[down]) {
// 2.업로드파일출력 시작
$gfile = ($_GET[view])? $_GET[view]:$_GET[down];
$filee = $did.str_replace("^","",str_replace("/","",$gfile));
$gfile = str_replace("^","%",$gfile);
if(strchr($_SERVER[HTTP_USER_AGENT],"Firefox")) $gfile = urldecode($gfile);
if(file_exists($filee) && $nick){
if($_GET[view]) $ext = strtolower(substr($gfile,-4));
if($ext=='.jpg' || $ext=='.gif' || $ext=='.png' || $ext=='.bmp'){
header("Content-type:image/jpeg; charset=euc-kr");
header("Content-Disposition: inline; filename=$gfile");
} else {
header("Content-Type: doesn/matter; charset=euc-kr");
header("Content-Disposition:attachment; filename=$gfile");
}
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".filesize($filee));
@readfile($filee);
} else {
header ("Content-Type: text/html; charset=euc-kr");
echo "<h1>파일이 없습니다..</h1>";
}
}
}
?>
<form action="<?=$_SERVER[PHP_SELF]?>" name='dupload' enctype='multipart/form-data' method='post'>
<!-- 폼설정을 설정합니다. -->
<input type="file" name="file" style='position:xss__;top:0;left:0;width:400px;height:20px;font-size:9pt' onchange="if(this.value)document.dupload.submit();" />
</form><!-- 폼을 닫습니다 -->
<tr><td colspan='2'><div id='filediv' style='display:none;margin:0;'>

 

댓글
  • No Nickname
    No Comment
  • 권한이 없습니다.
    {{m_row.m_nick}}
    -
제목 작성자 날짜
공대여자
mins
초보
bolpid
클리티에
질문자
김지영
^^
오한호
하정재
하정재
하정재