게시물의 첨부파일 이름 가져오기 > 그누4 팁자료실

그누4 팁자료실

그누보드4와 관련된 팁을 여러분들과 함께 공유하세요.
나누면 즐거움이 커집니다.

게시물의 첨부파일 이름 가져오기 정보

게시물의 첨부파일 이름 가져오기

본문

업로드한 파일의 원본파일명을 가져오는 함수입니다.
echo get_orifilename("보드명", "글번호"); 
이렇게 하면 파일명을 출력합니다. 

function get_orifilename($bo_table, $wr_id, $order=0) { 
  global $g4; 
  $sql = "select bf_source from `$g4[board_file_table]` where bo_table='$bo_table' AND wr_id='$wr_id' order by bf_no LIMIT $order, 1"; 
  $temp = sql_fetch($sql); 
  return $temp[bf_source]; 
}

업로드된 파일의 실제파일명을 가져오는 함수는 다음과 같이 만들 수 있겠네요.

function get_encfilename($bo_table, $wr_id, $order=0) {
global $g4;
$sql = "select bf_file from `$g4[board_file_table]` where bo_table='$bo_table' AND wr_id='$wr_id' order by bf_no LIMIT $order, 1";
$temp = sql_fetch($sql);
return $temp[bf_file];
}
추천
3

댓글 7개

전체 29 |RSS
그누4 팁자료실 내용 검색

회원로그인

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