게시물의 첨부파일 이름 가져오기 > 그누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개

© SIRSOFT
현재 페이지 제일 처음으로