첨부 파일 저장 주소

첨부 파일 저장 주소

QA

첨부 파일 저장 주소

본문

업로드된 파일명이 지정된 변수를 알 수 있을까요?

아니면 변수를 지정하고 있는 곳은 어디인지.

 

첨부 파일 경로명에 태그를 씌워 활용하려고 합니다.

 

예를 들면

 

<video src="첨부파일 경로명">

<img src="첨부파일 경로명">

 

이 때 경로에

 

<?=view[file][0][href]?>

를 넣으면 첫번째 첨부파일 경로명으로 설정되는 것으로 파악했으나

 

해당 경로명은 

 

download.php?로 시작하는 주소로

파일 경로가 명확하지 않으며 다운로드 권한이 없는 경우 확인이 불가능한 단점을 확인했습니다.

 

따라서 첨부파일 경로명을

(그누보드설치경로)/data/file/$bo_table/이하 복잡하게 변경된 파일명

 

으로 설정하고자 하는데 복잡하게 변경된 파일명의 변수를 찾지 못해 사용하지 못하고 있습니다.

 

알려주시면 정말 감사하겠습니다.

 

 

오늘 오전 11시 부터 지금 밤 12시가 되도록 헤매고 있습니다...

이 질문에 댓글 쓰기 :

답변 2

뷰스킨에서는

첨부화일명은 $view[file][0][file], $view[file][1][file]~~~ 이런 변수에 들어있습니다

 print_r($view) 해보면 모든 변수와 값이 주루룩 나옵니다

 

common 파일에 있는것을 확인하였으나 여전히 정확한 파일명 변수를 모르겠습니다.

 

// 게시글에 첨부된 파일을 얻는다. (배열로 반환)
function get_file($bo_table, $wr_id)
{
    global $g5, $qstr;

    $file['count'] = 0;
    $sql = " select * from {$g5['board_file_table']} where bo_table = '$bo_table' and wr_id = '$wr_id' order by bf_no ";
    $result = sql_query($sql);
    while ($row = sql_fetch_array($result))
    {
        $no = $row['bf_no'];
        $file[$no]['href'] = G5_BBS_URL."/download.php?bo_table=$bo_table&wr_id=$wr_id&no=$no" . $qstr;
        $file[$no]['download'] = $row['bf_download'];
        // 4.00.11 - 파일 path 추가
        $file[$no]['path'] = G5_DATA_URL.'/file/'.$bo_table;
        $file[$no]['size'] = get_filesize($row['bf_filesize']);
        $file[$no]['datetime'] = $row['bf_datetime'];
        $file[$no]['source'] = addslashes($row['bf_source']);
        $file[$no]['bf_content'] = $row['bf_content'];
        $file[$no]['content'] = get_text($row['bf_content']);
        //$file[$no]['view'] = view_file_link($row['bf_file'], $file[$no]['content']);
        $file[$no]['view'] = view_file_link($row['bf_file'], $row['bf_width'], $row['bf_height'], $file[$no]['content']);
        $file[$no]['file'] = $row['bf_file'];
        $file[$no]['image_width'] = $row['bf_width'] ? $row['bf_width'] : 640;
        $file[$no]['image_height'] = $row['bf_height'] ? $row['bf_height'] : 480;
        $file[$no]['image_type'] = $row['bf_type'];
        $file['count']++;
    }

    return $file;
}

 


// 파일명 치환
function replace_filename($name)
{
    @session_start();
    $ss_id = session_id();
    $usec = get_microtime();
    $ext = array_pop(explode('.', $name));

    return sha1($ss_id.$_SERVER['REMOTE_ADDR'].$usec).'.'.$ext;
}
답변을 작성하시기 전에 로그인 해주세요.
전체 0 | RSS
QA 내용 검색
  • 개별 목록 구성 제목 답변작성자조회작성일
  • 질문이 없습니다.

회원로그인

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