조회 : 115
원인이 뭔지는 모르겟으나, 업로드 기능이 작동을 안해요 ㅠㅠ
@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;'>
제목 |
---|
태그 적용 |
여보세요? 손님도 적으실 수 있습니다. 11 |
일 |
월 |
화 |
수 |
목 |
금 |
토 |
---|---|---|---|---|---|---|
7.27
|
7.28
|
7.29
|
7.30
|
7.31
|
8.1
|
8.2
|
8.3
|
8.4
|
8.5
|
8.6
|
8.7
|
8.8
|
8.9
|
8.10
|
8.11
|
8.12
|
8.13
|
8.14
|
8.15
|
8.16
|
8.17
|
8.18
|
8.19
|
8.20
|
8.21
|
8.22
|
8.23
|
8.24
|
8.25
|
8.26
|
8.27
|
8.28
|
8.29
|
8.30
|
8.31
|
9.1
|
9.2
|
9.3
|
9.4
|
9.5
|
9.6
|