리스트뷰 다운로드 잘못된접근 처리방법 질문있습니다...

리스트뷰 다운로드 잘못된접근 처리방법 질문있습니다...

QA

리스트뷰 다운로드 잘못된접근 처리방법 질문있습니다...

답변 2

본문

 

<li style="padding:10px 0 0;border-bottom:dotted 1px #ccc;">

<?

$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);

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_content = addslashes($row[bf_content]);

$file_type = strtolower(preg_replace('/^.*\.([^.]+)$/D', '$1', $file_source));

$file_size = get_filesize($row[bf_filesize]);

 

if(!in_array($file_type, array('php', 'asp', 'aspx', 'jsp', 'js'))){ //이미지는 제외

echo "<a class='attached-file' href=\"".$down_link."\" title=\"".$file_content."\">";

echo "<img src='". G5_IMG_URL ."/filetype/". $file_type .".gif' border=0 align='absmiddle' alt=\"".$file_content."\">{$file_source} ({$file_size})";

echo "</a>";

}

}

?>

</li>

 

이부분에서 무언가 잘못되었는지

리스트뷰에서 PDF파일을 클릭시에 잘못된 접근입니다.라는 알림창이 뜹니다...

그리고 뷰페이지 에서는 정상적으로 파일이 다운로드가 되고

이후 다시 리스트뷰에서 클릭시에 바로 다운로드가 이루어지는데

어디서 잘못됬는지 알수가없네요 ㅠㅠ 도움좀 주세요 ㅠㅠ

이 질문에 댓글 쓰기 :

답변 2

세션이 없어서 그렇습니다.

<?

set_session('ss_view_'.$bo_table.'_'.$list[$i][wr_id], TRUE); 

$sql = " select * from $g5[board_file_table] where bo_table = '". $bo_table. "' and wr_id = '". $list[$i][wr_id] ."' order by bf_no ";

 

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 1,178
© SIRSOFT
현재 페이지 제일 처음으로