파일 절대경로

파일 절대경로

QA

파일 절대경로

본문

게시판 view 페이지에서

첫번째 파일만 빼고 나머지들은 작게 나오려고 하는 중인데요.

 

이미지들이 X박스가 떠서 속성들어가서 이미지 주소를 확인해보니

 

http://lucidglass.mireene.co.kr/web/home/lucidglass/html/data/file/sunglasses/1883821410_rvniVeKT_1.jpg 

 

이런식으로 절대경로까지 포함되서 나오네요.

어딜 수정해야하는걸까요..

아래는 썸네일 불러오는 코드입니다.

 

 
<?
$sql = " select bf_file from $g5[board_file_table] where bo_table = '$bo_table' and wr_id = '$wr_id' order by bf_no limit 0, 10 "; 
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++) {
//썸네일 코드 시작
$data_path = G5_PATH. "/data/file/{$bo_table}";//라이브러리 파일 참조
$filename = $row[bf_file]; //파일명
$thumb_path = G5_PATH.'/data/file/'.$bo_table;
$view_w = 90; //썸네일 가로사이즈
$view_h = 70; //썸네일 세로사이즈
$sch_q = 100; //썸네일 퀼리티
if (!is_dir($thumb_path)) {
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
}
    $filename = $row['bf_file'];
    $thumb = $thumb_path.'/'.$filename; //썸네일
    if (!file_exists($thumb))
    {
 $file = $data_path.'/'.$filename; //원본
        if (preg_match("/\.(jp[e]?g|gif|png)$/i", $file) && file_exists($file))
        {
            $size = getimagesize($file);
            if ($size[2] == 1)
                $src = imagecreatefromgif($file);
            else if ($size[2] == 2)
                $src = imagecreatefromjpeg($file);
            else if ($size[2] == 3)
                $src = imagecreatefrompng($file);
            else
                continue;
            $rate = $view_w / $size[0];
            $height = (int)($size[1] * $rate);
            if ($height < $view_h)
                $dst = imagecreatetruecolor($view_w, $height);
            else
                $dst = imagecreatetruecolor($view_w, $view_h);
            imagecopyresampled($dst, $src, 0, 0, 0, 0, $view_w, $height, $size[0], $size[1]);
            imagejpeg($dst, $thumb_path.'/'.$filename, $sch_q);
            chmod($thumb_path.'/'.$filename, 0707);
        }
    }
 if (file_exists($thumb) && $filename) {
?>
 
<a href=javascript:void(0); onClick=View_Open('#')" onMouseOver="bgChange('view_img{$i}');" onMouseOut="bgChange(view_img{$i}');"><img src='<?=$thumb?>' border=1 width=90 height=70 style="border-color:#d5d5d5;"></a>

<?
}
}
?>​

 

이 질문에 댓글 쓰기 :

답변을 작성하시기 전에 로그인 해주세요.
전체 123,823 | RSS
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT