파일 업로드 용량제한 초과시 경고창

파일 업로드 용량제한 초과시 경고창

QA

파일 업로드 용량제한 초과시 경고창

답변 2

본문

파일 업로드시 용량이 초과되면 경고창을 띄우고 싶습니다.

기본적으로 제공되는건데 버그로 안되는건지 따로 작업의해야하는지 궁금합니다.

해당아래 소스는 제가 사용하는 게시판의 첨부파일 부분입니다.

기본적으로 나온 게시판 수정없이 사용하고 있습니다.

 


<?php for ($i=0; $is_file && $i<$file_count; $i++) { ?>
    <div class="bo_w_flie">
        <div class="file_wr">
            <label for="bf_file_<?php echo $i+1 ?>" class="lb_icon"><i class="fa fa-download" aria-hidden="true"></i><span class="sound_only"> 파일 #<?php echo $i+1 ?></span></label>
            <input type="file" name="bf_file[]" id="bf_file_<?php echo $i+1 ?>" title="파일첨부 <?php echo $i+1 ?> : 용량 <?php echo $upload_max_filesize ?> 이하만 업로드 가능" class="frm_file ">
        </div>
        <?php if ($is_file_content) { ?>
        <input type="text" name="bf_content[]" value="<?php echo ($w == 'u') ? $file[$i]['bf_content'] : ''; ?>" title="파일 설명을 입력해주세요." class="full_input frm_input" size="50" placeholder="파일 설명을 입력해주세요.">
        <?php } ?>
        <?php if($w == 'u' && $file[$i]['file']) { ?>
        <span class="file_del">
            <input type="checkbox" id="bf_file_del<?php echo $i ?>" name="bf_file_del[<?php echo $i;  ?>]" value="1"> <label for="bf_file_del<?php echo $i ?>"><?php echo $file[$i]['source'].'('.$file[$i]['size'].')';  ?> 파일 삭제</label>
        </span>
        <?php } ?>
    </div>
    <?php } ?>

 

 

이 질문에 댓글 쓰기 :

답변 2

https://sir.kr/g5_tip/8645

용량 체크입니다. 확인해 보세요 

파일 첨부할떄 체크하지는 않고 글 작성후 체크를 합니다.

작성 체크를 해도 크기 여부를 체크하지 않으시던가요?

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 129
© SIRSOFT
현재 페이지 제일 처음으로