첨부파일에 pdf 파일을 첨부했을 때 바로보이게 할려면? 정보
첨부파일에 pdf 파일을 첨부했을 때 바로보이게 할려면?본문
안녕하세요. 많은 도움 부탁드립니다.
일단 첨부파일에 PDF 파일을 첨부했습니다.
그리고 리스트 목록에 버튼을 삽입해서 첨부파일을 링크하게 해놓았습니다.
버튼을 클릭하면 해당 파일을 열기나 저장이라는 버튼이 정상적으로 가동은 됩니다.
제가 원하는 것은 버튼을 클릭하면 해당 pdf 를 브라우져로 직접 보이게 하고 싶어서요.
물론 ftp로 pdf파일을 올리고 링크 주소를 ftp로 올린 파일을 지정해주면 정상적으로
브라우저에서 확인이 가능한데요.
링크주소가 아닌 첨부파일을 직접 보이게 하고 싶어서요.
즉.download.php를 거치지 않고 그냥 주소가 다 노출되면 될것 같아요.
혹시 아시는 분은 도움 좀 주세요.
리스트에서는 아래와 같이해서 첨부파일이 있을 때 버튼이 나오게 누가 올려주신것 가지고 했습니다.
<?
$ss_name = "ss_view_{$bo_table}_{$list[$i][wr_id]}";
session_register($ss_name);
$$ss_name = $HTTP_SESSION_VARS[$ss_name] = TRUE;
//첨두 1번때 2번째 설정
if($list[$i][file][0][view] == !file_exists($img) && $list[$i][file][1][view] == !file_exists($img)) {//둘다 이미지일때
echo "";
} else if($list[$i][file][0][view] == !file_exists($img) && !$list[$i][file][1]) {//처음 이미지일때 두번째가 없을때
echo "";
} else if(!$list[$i][file][0] && !$list[$i][file][0]) {//둘다 없을때
echo "";
} else if($list[$i][file][0][view] == !file_exists($img) && $list[$i][file][1][view] == file_exists($img)) {//처음 이미지일때 두번째가 파일때
$down_link1 = "download.php?bo_table=" . $bo_table . "&wr_id=" . $list[$i][wr_id] . "&no=1";
echo "<a href='$down_link1'>";
echo " <img src='$board_skin_path/img/btn_cate1.gif' border=0>";
echo "</a>";
} else if($list[$i][file][0][view] == file_exists($img) && !$list[$i][file][1]) {//처음 파일 두번째가 없을때
$down_link0 = "download.php?bo_table=" . $bo_table . "&wr_id=" . $list[$i][wr_id] . "&no=0";
echo "<a href='$down_link0'>";
echo " <img src='$board_skin_path/img/btn_cate1.gif' border=0>";
echo "</a>";
} else if($list[$i][file][0][view] == file_exists($img) && $list[$i][file][1][view] == file_exists($img)) {//둘다 파일 일때
$down_link0 = "download.php?bo_table=" . $bo_table . "&wr_id=" . $list[$i][wr_id] . "&no=0";
$down_link1 = "download.php?bo_table=" . $bo_table . "&wr_id=" . $list[$i][wr_id] . "&no=1";
echo "<a href='$down_link0'>";
echo " <img src='$board_skin_path/img/btn_cate1.gif' border=0>";
echo "</a>";
echo "<a href='$down_link1'>";
echo " <img src='$board_skin_path/img/btn_cate1.gif' border=1>";
echo "</a>";
} else if($list[$i][file][0][view] == file_exists($img) && $list[$i][file][1][view] == !file_exists($img)) {//처음 파일 두번째가 이미지때
$down_link0 = "download.php?bo_table=" . $bo_table . "&wr_id=" . $list[$i][wr_id] . "&no=0";
echo "<a href='$down_link0'>";
echo " <img src='$board_skin_path/img/btn_cate1.gif' border=0>";
echo "</a>";
}
?>
일단 첨부파일에 PDF 파일을 첨부했습니다.
그리고 리스트 목록에 버튼을 삽입해서 첨부파일을 링크하게 해놓았습니다.
버튼을 클릭하면 해당 파일을 열기나 저장이라는 버튼이 정상적으로 가동은 됩니다.
제가 원하는 것은 버튼을 클릭하면 해당 pdf 를 브라우져로 직접 보이게 하고 싶어서요.
물론 ftp로 pdf파일을 올리고 링크 주소를 ftp로 올린 파일을 지정해주면 정상적으로
브라우저에서 확인이 가능한데요.
링크주소가 아닌 첨부파일을 직접 보이게 하고 싶어서요.
즉.download.php를 거치지 않고 그냥 주소가 다 노출되면 될것 같아요.
혹시 아시는 분은 도움 좀 주세요.
리스트에서는 아래와 같이해서 첨부파일이 있을 때 버튼이 나오게 누가 올려주신것 가지고 했습니다.
<?
$ss_name = "ss_view_{$bo_table}_{$list[$i][wr_id]}";
session_register($ss_name);
$$ss_name = $HTTP_SESSION_VARS[$ss_name] = TRUE;
//첨두 1번때 2번째 설정
if($list[$i][file][0][view] == !file_exists($img) && $list[$i][file][1][view] == !file_exists($img)) {//둘다 이미지일때
echo "";
} else if($list[$i][file][0][view] == !file_exists($img) && !$list[$i][file][1]) {//처음 이미지일때 두번째가 없을때
echo "";
} else if(!$list[$i][file][0] && !$list[$i][file][0]) {//둘다 없을때
echo "";
} else if($list[$i][file][0][view] == !file_exists($img) && $list[$i][file][1][view] == file_exists($img)) {//처음 이미지일때 두번째가 파일때
$down_link1 = "download.php?bo_table=" . $bo_table . "&wr_id=" . $list[$i][wr_id] . "&no=1";
echo "<a href='$down_link1'>";
echo " <img src='$board_skin_path/img/btn_cate1.gif' border=0>";
echo "</a>";
} else if($list[$i][file][0][view] == file_exists($img) && !$list[$i][file][1]) {//처음 파일 두번째가 없을때
$down_link0 = "download.php?bo_table=" . $bo_table . "&wr_id=" . $list[$i][wr_id] . "&no=0";
echo "<a href='$down_link0'>";
echo " <img src='$board_skin_path/img/btn_cate1.gif' border=0>";
echo "</a>";
} else if($list[$i][file][0][view] == file_exists($img) && $list[$i][file][1][view] == file_exists($img)) {//둘다 파일 일때
$down_link0 = "download.php?bo_table=" . $bo_table . "&wr_id=" . $list[$i][wr_id] . "&no=0";
$down_link1 = "download.php?bo_table=" . $bo_table . "&wr_id=" . $list[$i][wr_id] . "&no=1";
echo "<a href='$down_link0'>";
echo " <img src='$board_skin_path/img/btn_cate1.gif' border=0>";
echo "</a>";
echo "<a href='$down_link1'>";
echo " <img src='$board_skin_path/img/btn_cate1.gif' border=1>";
echo "</a>";
} else if($list[$i][file][0][view] == file_exists($img) && $list[$i][file][1][view] == !file_exists($img)) {//처음 파일 두번째가 이미지때
$down_link0 = "download.php?bo_table=" . $bo_table . "&wr_id=" . $list[$i][wr_id] . "&no=0";
echo "<a href='$down_link0'>";
echo " <img src='$board_skin_path/img/btn_cate1.gif' border=0>";
echo "</a>";
}
?>
댓글 전체