첨부파일 질문 드립니다!
본문
첨부파일에 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>
파일을 첨부하는 부분의 코드입니다.
---------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------
현재 이렇게 hwp파일을 첨부하고, 다운로드 버튼을 누르면,
---------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------
파일정보가 존재하지 않는다고 뜹니다ㅜㅜ
그누보드 고수님들 고쳐야 할 부분에 대해 많은 조언 부탁드립니다!!
!-->!-->
답변을 작성하시기 전에 로그인 해주세요.