첨부파일 질문 드립니다!

첨부파일 질문 드립니다!

QA

첨부파일 질문 드립니다!

본문

첨부파일에 pdf, hwp등의 문서파일을 첨부하고, 다운로드 버튼을 만들어 버튼을 누르면 다운로드 되도록 하고싶습니다. 

 


//view.skin.php

<? echo '<a href="' . $view['file'][3]['href'] . '" class="view_file_download"><button><strong>다운로드</strong></button></a>';
if ($i > 0) echo ''.PHP_EOL;
?>

이게 다운로드 버튼 코드입니다.

 


//write.skin.php

<? for ($i=0; $is_file && $i<$file_count-1; $i++) {
    $file_path = $file[$i]['path']."/".$file[$i][file];//이미지의 경로 
?>
<tr>
    <th scope="row">제품사진 #<?=$i+1?></th>
    <td>
        <input type="file" name="bf_file[]" title="파일첨부 <?=$i+1?> :  용량 <?=$upload_max_filesize?> 이하만 업로드 가능" class="frm_file frm_input">
        <? if ($is_file_content) { ?>
        <input type="text" name="bf_content[]" value="<? echo $file[$i]['bf_content']; ?>" title="파일 설명을 입력해주세요." class="frm_file frm_input" size="50">
        <? } ?>
        <? if($w == 'u' && $file[$i]['file']) { ?>
        <input type="checkbox" id="bf_file_del<?=$i?>" name="bf_file_del[<? echo $i; ?>]" value="1"> <label for="bf_file_del<?=$i?>"><? echo $file[$i]['source'].'('.$file[$i]['size'].')'; ?> 파일 삭제</label>
        <div class="rankiss_oimg">
            <a href="<?php echo G4_BBS_URL; ?>/view_image.php?fn=<?php echo $bo_table.'/'.urlencode($file[$i][file]); ?>" target="_blank"><img src="<?php echo $file_path; ?>" alt="<?php echo $file[$i]['source']; ?>"></a>
        </div>
        <? } ?>
    </td>
</tr>

<? } echo '<th scope="row">첨부파일 #<?= $file_count ?></th>'; ?>
<td>
    <input type="file" name="bf_file[]" title="파일첨부 <?=$file_count?> :  용량 <?=$upload_max_filesize?> 이하만 업로드 가능" class="frm_file frm_input">
    <? if ($is_file_content) { ?>
        <input type="text" name="bf_content[]" value="<? echo $file[$file_count]['bf_content']; ?>" title="파일 설명을 입력해주세요." class="frm_file frm_input" size="50">
    <? } ?>
    <? if($w == 'u' && $file[$file_count]['file']) { ?>
        <input type="checkbox" id="bf_file_del<?=$i?>" name="bf_file_del[<? echo $file_count; ?>]" value="1"> <label for="bf_file_del<?=$file_count?>"><? echo $file[$file_count]['source'].'('.$file[$file_count]['size'].')'; ?> 파일 삭제</label>
        <div class="rankiss_oimg">
            <a href="<?php echo G4_BBS_URL; ?>/view_image.php?fn=<?php echo $bo_table.'/'.urlencode($file[$file_count][file]); ?>" target="_blank"><img src="<?php echo $file_path; ?>" alt="<?php echo $file[$file_count]['source']; ?>"></a>
        </div>
    <? } ?>
</td>


파일을 첨부하는 부분의 코드입니다.

 

---------------------------------------------------------------------------------------------------------

1028775886_1565072127.791.png

---------------------------------------------------------------------------------------------------------

현재 이렇게 hwp파일을 첨부하고, 다운로드 버튼을 누르면,

 

---------------------------------------------------------------------------------------------------------

1028775886_1565072173.5443.png

---------------------------------------------------------------------------------------------------------

파일정보가 존재하지 않는다고 뜹니다ㅜㅜ 

 

그누보드 고수님들 고쳐야 할 부분에 대해 많은 조언 부탁드립니다!!

이 질문에 댓글 쓰기 :

답변 1

마지막에 첨부파일#5 가 아니고 그냥 첨부파일# 인건가요?

답변을 작성하시기 전에 로그인 해주세요.
전체 32
QA 내용 검색

회원로그인

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