엑셀 다운로드 할때, 첨부파일 이미지 경로 문의입니다.

엑셀 다운로드 할때, 첨부파일 이미지 경로 문의입니다.

QA

엑셀 다운로드 할때, 첨부파일 이미지 경로 문의입니다.

본문

엑셀 다운로드시 첨부파일 이미지 경로 문의입니다.

정확한 이미지 경로로 작성하면 엑셀에서 이미지가 잘 나오는건 확인되었습니다.

 

뷰페이지에서 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.'">';
?>

이 질문에 댓글 쓰기 :

답변 1

실제 저장되어있는 파일명은 bf_source일텐데 그걸로 해보세요

답변감사드립니다. 답변내용검색해서 원하는 답을 찾았습니다!


<?php
$qmanse_sql = " select bf_file from g5_board_file where wr_id='$wr_id' and bf_no='0'";

$q_r=sql_fetch($qmanse_sql); 

echo '<img src="http://주소/data/file/test/'.$q_r['bf_file'].'" alt="'.$thumb['alt'].'" width="'.$imgwidth.'" height="'.$imgheight.'">';
?>

답변을 작성하시기 전에 로그인 해주세요.
전체 0
QA 내용 검색
  • 개별 목록 구성 제목 답변작성자조회작성일
  • 질문이 없습니다.

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT