코멘트 파일첨부 질문입니다.. 채택완료
humanb2box
8년 전
조회 2,996
코멘트에 파일첨부를 하고싶어서 검색하던중
아래 링크를 찾았습니다.
https://sir.kr/g4_qa/44556" target="_self">https://sir.kr/g4_qa/44556
해당글 참고하여 g4를 g5로 수정했는데 도무지 파일이 올라가지가 않습니다....
제발...
적용가능케 도와주소서..
view comment 스킨 첨부 코드 입니다.
</p><p style="font-size: 14.6667px;">
</p><p style="font-size: 14.6667px;"><tr></p><p style="font-size: 14.6667px;"> <th scope="row">파일첨부</th></p><p style="font-size: 14.6667px;"> <td class="border_r0"><input type=file name=comment_file id="comAdd"></td></p><p style="font-size: 14.6667px;"> </tr></p><p style="font-size: 14.6667px;">
물론 폼에 enctype="multipart/form-data" 추가하였습니다.
view comment 업데이트 스킨 파일 코드 입니다.
</p><p style="font-size: 14.6667px;"><?php</p><p style="font-size: 14.6667px;">if(is_uploaded_file($comment_file)) { </p><p style="font-size: 14.6667px;">
</p><p style="font-size: 14.6667px;"> $tmp_file = $_FILES[comment_file][tmp_name]; </p><p style="font-size: 14.6667px;"> $filename = $_FILES[comment_file][name]; </p><p style="font-size: 14.6667px;"> $filesize = $_FILES[comment_file][size]; </p><p style="font-size: 14.6667px;">
</p><p style="font-size: 14.6667px;"> $dest = "$g5[path]/data/file/$bo_table/".$HTTP_POST_FILES[comment_file][name]; </p><p style="font-size: 14.6667px;"><span style="white-space: pre;"> </span>move_uploaded_file($HTTP_POST_FILES[comment_file][tmp_name], "$dest"); </p><p style="font-size: 14.6667px;"> $imagesize = @getimagesize($dest); </p><p style="font-size: 14.6667px;"> $sql = " insert into $g5[board_file_table] </p><p style="font-size: 14.6667px;"> set bo_table = '$bo_table', </p><p style="font-size: 14.6667px;"> wr_id = '$comment_id', </p><p style="font-size: 14.6667px;"> bf_no = '1', </p><p style="font-size: 14.6667px;"> bf_source = '$filename', </p><p style="font-size: 14.6667px;"> bf_file = '$filename', </p><p style="font-size: 14.6667px;"> bf_content = '{$bf_content}', </p><p style="font-size: 14.6667px;"> bf_download = 0, </p><p style="font-size: 14.6667px;"> bf_filesize = '$filesize', </p><p style="font-size: 14.6667px;"> bf_width = '{$imagesize[0]}', </p><p style="font-size: 14.6667px;"> bf_height = '{$imagesize[1]}', </p><p style="font-size: 14.6667px;"> bf_type = '{$imagesize[2]}', </p><p style="font-size: 14.6667px;"> bf_datetime = '$g5[time_ymdhis]' "; </p><p style="font-size: 14.6667px;"> sql_query($sql); </p><p style="font-size: 14.6667px;">
</p><p style="font-size: 14.6667px;">} </p><p style="font-size: 14.6667px;">alert("asdf");</p><p style="font-size: 14.6667px;">
</p><p style="font-size: 14.6667px;">?></p><p style="font-size: 14.6667px;">
댓글을 작성하려면 로그인이 필요합니다.
답변 2개
8년 전
https://sir.kr/g4_skin/138511">https://sir.kr/g4_skin/138511
이게 그나마 최신글이라 여기도 참고하시면 좋을 듯해요,,
혹시 이거 완성되시면 공유좀 부탁드리겠습니다.
여기 자유게시판에서 쓰던데..그런건 공개를 안하더군요,,
정책이인지 뭔지 알수는 없지만,,,
로그인 후 평가할 수 있습니다
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인
그냥 글은 잘올라간느데 파일이 첨부가 안됩니다.
해당 게시판 폴더에 쌓이지가 않아요 파일이