코멘트 파일첨부질문입니다.... 채택완료
humanb2box
8년 전
조회 2,245
코멘트에 파일첨부를 하고싶어서 검색하던중
아래 링크를 찾았습니다.
https://sir.kr/g4_qa/44556" target="_self">https://sir.kr/g4_qa/44556
해당글 참고하여 g4를 g5로 수정했는데 도무지 파일이 올라가지가 않습니다....
제발...
적용가능케 도와주소서..
view comment 스킨 첨부 코드 입니다.
</p><p>
</p><p><tr></p><p> <th scope="row">파일첨부</th></p><p> <td class="border_r0"><input type=file name=comment_file id="comAdd"></td></p><p> </tr></p><p>
물론 폼에 enctype="multipart/form-data" 추가하였습니다.
view comment 업데이트 스킨 파일 코드 입니다.
</p><p><?php</p><p>if(is_uploaded_file($comment_file)) { </p><p>
</p><p> $tmp_file = $_FILES[comment_file][tmp_name]; </p><p> $filename = $_FILES[comment_file][name]; </p><p> $filesize = $_FILES[comment_file][size]; </p><p>
</p><p> $dest = "$g5[path]/data/file/$bo_table/".$HTTP_POST_FILES[comment_file][name]; </p><p><span style="white-space:pre"> </span>move_uploaded_file($HTTP_POST_FILES[comment_file][tmp_name], "$dest"); </p><p> $imagesize = @getimagesize($dest); </p><p> $sql = " insert into $g5[board_file_table] </p><p> set bo_table = '$bo_table', </p><p> wr_id = '$comment_id', </p><p> bf_no = '1', </p><p> bf_source = '$filename', </p><p> bf_file = '$filename', </p><p> bf_content = '{$bf_content}', </p><p> bf_download = 0, </p><p> bf_filesize = '$filesize', </p><p> bf_width = '{$imagesize[0]}', </p><p> bf_height = '{$imagesize[1]}', </p><p> bf_type = '{$imagesize[2]}', </p><p> bf_datetime = '$g5[time_ymdhis]' "; </p><p> sql_query($sql); </p><p>
</p><p>} </p><p>alert("asdf");</p><p>
</p><p>?></p><p>
https://sir.kr/g4_qa/44556" target="_self">
댓글을 작성하려면 로그인이 필요합니다.
답변 1개
답변을 작성하려면 로그인이 필요합니다.
로그인