첨부파일명을 첨부파일1,첨부파일2...아니고 다른거로 바꿀려고 합니다

첨부파일명을 첨부파일1,첨부파일2...아니고 다른거로 바꿀려고 합니다

QA

첨부파일명을 첨부파일1,첨부파일2...아니고 다른거로 바꿀려고 합니다

본문

첨부파일명을 "첨부파일1,첨부파일2" 아니고 다른거로 바꿀려고 합니다

"첨부파일1,첨부파일2"  이거를 "실내사진,실외사진" 이렇게 바꿀려면 어떻게 수정하면 될까요?

 

아래처럼 하면은 첨부파일2자리에 "실내사진실외사진"이렇게 됩니다.

 

2007338422_1740767035.3844.jpg

 

<?php for ($i=0; $is_file && $i<$file_count; $i++) {
        if($i=='0'){ 
            $file_n .= '실내사진';
         }else if($i=='1') {
            $file_n .= '실외사진';
        }
    ?>
    
    <div class="bo_w_flie write_div">
        <div class="file_wr write_div">
            <label for="bf_file_<?php echo $i+1 ?>" class="lb_icon"><i class="fa fa-folder-open" aria-hidden="true"></i><span class=""> <?php echo $file_n;?></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 " onChange="setNewImg(this,'<?php echo $i+1 ?>');">
            <? if($file[$i]['file']){?>
                <img id="View<?php echo $i+1 ?>" src="../data/file/<?=$bo_table?>/<?=$file[$i]['file']?>" alt="이미지 미리보기" width="60"  border="0" />
            <? }else{?>
                <img id="View<?php echo $i+1 ?>" src="#" alt="이미지 미리보기" width="60" style="display:none" border="0" />            
            <? }?>

        </div>

        <?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[0]" value="1"> <label for="bf_file_del<?php echo $i ?>"><?php echo $file[$i]['source'].'('.$file[$i]['size'].')';  ?> 파일 삭제</label>
        </span>
        <?php } ?>
        
    </div>
    <?php } ?>

 

이 질문에 댓글 쓰기 :

답변 2


    <?php for ($i=0; $is_file && $i<$file_count; $i++) { ?>
    <div class="bo_w_flie write_div">
        <div class="file_wr write_div">
            <label for="bf_file_<?php echo $i+1 ?>" class="lb_icon"><i class="fa fa-folder-open" 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 } ?>

=>


    <?php for ($i=0; $is_file && $i<$file_count; $i++) { ?>
    <div class="bo_w_flie write_div">
        <div class="file_wr write_div">
            <label for="bf_file_<?php echo $i+1 ?>" class="lb_icon"><i class="fa fa-folder-open" aria-hidden="true"></i><span class="sound_only"> 파일 #<?php echo $i+1 ?></span></label>
        <input type="button" value="<?php echo ($i == 0) ? '실내사진' : (($i == 1) ? '실외사진' : '파일 선택');?>" id="ba_file_<?php echo $i+1 ?>" onclick="document.getElementById('bf_file_<?php echo $i+1 ?>').click()" title="파일첨부 <?php echo $i+1 ?> : 용량 <?php echo $upload_max_filesize ?> 이하만 업로드 가능" class="frm_file ">
        <label for="<?php echo $i ?>" id="file-name_<?php echo $i+1 ?>" class="homepage">선택된 파일 없음</label>
            <input type="file" name="bf_file[]" style="display:none" id="bf_file_<?php echo $i+1 ?>" title="파일첨부 <?php echo $i+1 ?> : 용량 <?php echo $upload_max_filesize ?> 이하만 업로드 가능" class="frm_file ">
        </div>
        <script>
            inputElement<?php echo $i+1 ?> = document.getElementById('bf_file_<?php echo $i+1 ?>');
            labelElement<?php echo $i+1 ?> = document.getElementById('file-name_<?php echo $i+1 ?>');
            inputElement<?php echo $i+1 ?>.onchange = function(event) {
                var path = inputElement<?php echo $i+1 ?>.value;
                labelElement<?php echo $i+1 ?>.innerHTML = path.split(/(\\|\/)/g).pop();
            }
        </script>
        <?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 } ?>

또는


    <?php for ($i=0; $is_file && $i<$file_count; $i++) { ?>
    
    <div class="bo_w_flie write_div">
        <div class="file_wr write_div">
            <label for="bf_file_<?php echo $i+1 ?>" class="lb_icon"><i class="fa fa-folder-open" aria-hidden="true"></i><span class=""> <?php echo ($i == 0) ? '실내사진' : (($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 " onChange="setNewImg(this,'<?php echo $i+1 ?>');">
            <? if($file[$i]['file']){?>
                <img id="View<?php echo $i+1 ?>" src="../data/file/<?=$bo_table?>/<?=$file[$i]['file']?>" alt="이미지 미리보기" width="60"  border="0" />
            <? }else{?>
                <img id="View<?php echo $i+1 ?>" src="#" alt="이미지 미리보기" width="60" style="display:none" border="0" />            
            <? }?>
        </div>
        <?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[0]" value="1"> <label for="bf_file_del<?php echo $i ?>"><?php echo $file[$i]['source'].'('.$file[$i]['size'].')';  ?> 파일 삭제</label>
        </span>
        <?php } ?>
        
    </div>
    <?php } ?>
답변을 작성하시기 전에 로그인 해주세요.
전체 129,406 | RSS
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT