엑셀 다운로드 할때, 첨부파일 이미지 경로 문의입니다.
본문
엑셀 다운로드시 첨부파일 이미지 경로 문의입니다.
정확한 이미지 경로로 작성하면 엑셀에서 이미지가 잘 나오는건 확인되었습니다.
뷰페이지에서 xls_download.php 를 통해 엑셀을 다운로드를 받고 있습니다.
첨부파일 찾는 소스는
https://sir.kr/qa/105448 를 사용했습니다.
$filename = $is_print[$i][file][0][ bf_file];
이거 출력하면 아무것도 나오지 않아 잘못된건 알겠는데.....
list -> is_print , view 등으로 막 바꿔봐도 해결이 되지 않아 문의드립니다 ㅠㅠ
어떻게 작성해야 첨부파일 1번의 주소가 정확하게 나올까요
<?php
ob_start();
include_once($_SERVER['DOCUMENT_ROOT'] ."/common.php");
header("Cache-control: private");
header("Content-type:application/vnd.ms-excel; charset=euc-kr");
header("Content-Disposition:attachment;filename=123.xls");
$is_title="엑셀 문서 다운로드";
$bo_table=$_GET['bo_table'];
$wr_id=(int)$_GET['wr_id'];
$sql="select * from g5_write_test where wr_is_comment=0 and wr_id='{$wr_id}'";
$is_print=sql_fetch($sql);
include_once(G5_LIB_PATH.'/thumbnail.lib.php'); // 추가해 주어야 함
$imgwidth = "100";
$imgheight = "160";
$filename = $list[$i][file][0][bf_file]; // 0 첫번째 2 세번째
$filepath = 'http://주소/data/file/'.$bo_table;
$tname = thumbnail($filename, $filepath, $filepath, $imgwidth, $imgheight, $is_create, $is_crop, $crop_mode, $is_sharpen, $um_value);
$src = G5_URL.str_replace($filename, $tname, $ata_path);
$img_content1 = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" width="'.$imgwidth.'" height="'.$imgheight.'">';
?>
답변을 작성하시기 전에 로그인 해주세요.