테스트 사이트 - 개발 중인 베타 버전입니다

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

달려날아 7년 전 조회 3,794

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

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

 

뷰페이지에서 xls_download.php 를 통해 엑셀을 다운로드를 받고 있습니다.

 

첨부파일 찾는 소스는

https://sir.kr/qa/105448">https://sir.kr/qa/105448 를 사용했습니다.

 

$filename = $is_print[$i][file][0][ bf_file];

이거 출력하면 아무것도 나오지 않아 잘못된건 알겠는데.....

list -> is_print , view 등으로 막 바꿔봐도 해결이 되지 않아 문의드립니다 ㅠㅠ

 

어떻게 작성해야 첨부파일 1번의 주소가 정확하게 나올까요

</p>

<p><?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");</p>

<p>$is_title="엑셀 문서 다운로드";</p>

<p>$bo_table=$_GET['bo_table'];

$wr_id=(int)$_GET['wr_id'];</p>

<p>

$sql="select * from g5_write_test where wr_is_comment=0 and wr_id='{$wr_id}'";

$is_print=sql_fetch($sql);</p>

<p>

include_once(G5_LIB_PATH.'/thumbnail.lib.php'); // 추가해 주어야 함</p>

<p>$imgwidth = "100";

$imgheight = "160";

$filename = $list[$i][file][0][bf_file]; // 0 첫번째 2 세번째

$filepath = '<a _src="http://" href="http://">http://</a>주소/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.'">';</p>

<p>?></p>

<p>

댓글을 작성하려면 로그인이 필요합니다.

답변 1개

채택된 답변
+20 포인트
7년 전

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

로그인 후 평가할 수 있습니다

답변에 대한 댓글 1개

달려날아
7년 전
답변감사드립니다. 답변내용검색해서 원하는 답을 찾았습니다!

[code]
<?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.'">';
?>
[/code]

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인