PHP with GNU 리스트(목록)에서 첨부파일 다운로드
페이지 정보
- 작성자후야
- 조회 : 244
- 작성일 : 2022-02-16 13:39
본문
리스트(목록)에서 첨부파일 다운로드
관리자에서 "목록에서파일사용" 체크 후 사용
- code
- source
- $sql = "select * from {$g5['board_file_table']} where bo_table = '".$bo_table."' and wr_id = '".$list[$i]['wr_id']."' order by bf_no ";
- $result = sql_query($sql);
-
- $nonce = download_file_nonce_key($bo_table, $list[$i]['wr_id']);
-
- while ($row = sql_fetch_array($result)) {
- $down_link = "download.php?bo_table={$bo_table}&wr_id={$list[$i][wr_id]}&no={$row[bf_no]}";
- $file_source = addslashes($row['bf_source']);
- $file_type = preg_replace('/^.*\.([^.]+)$/D', '$1', $file_source);
- $file_size = get_filesize($row['bf_filesize']);
-
- if(!in_array($file_type, array('jpg', 'jpeg', 'gif', 'bmp', 'png'))){ //이미지는 제외
- echo '<a href="'.$down_link.'" title="'.$file_source.'" class="download"><i class="xi-file-download-o xi-x"></i>'.$file_source.'</a>';
- }
- }
$sql = "select * from {$g5['board_file_table']} where bo_table = '".$bo_table."' and wr_id = '".$list[$i]['wr_id']."' order by bf_no ";
$result = sql_query($sql);
$nonce = download_file_nonce_key($bo_table, $list[$i]['wr_id']);
while ($row = sql_fetch_array($result)) {
$down_link = "download.php?bo_table={$bo_table}&wr_id={$list[$i][wr_id]}&no={$row[bf_no]}";
$file_source = addslashes($row['bf_source']);
$file_type = preg_replace('/^.*\.([^.]+)$/D', '$1', $file_source);
$file_size = get_filesize($row['bf_filesize']);
if(!in_array($file_type, array('jpg', 'jpeg', 'gif', 'bmp', 'png'))){ //이미지는 제외
echo '<a href="'.$down_link.'" title="'.$file_source.'" class="download"><i class="xi-file-download-o xi-x"></i>'.$file_source.'</a>';
}
}
- 이전글view페이지 두번째 이미지 부터 출력하기 2022.02.16
- 다음글여분필드 확장 검색을 위한 예제 2022.01.10