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