다중 파일 다운로드 > SCRIPT

본문 바로가기
사이트 내 전체검색

SCRIPT

다중 파일 다운로드

페이지 정보

profile_image
작성자 관리자
댓글 0건 조회 5,180회 작성일 20-09-18 09:38

본문

<script>
  var suffix=1;
  function downloadAll(oFrm){
  var oChk = oFrm.elements["file"+(suffix++)];
  if (oChk){
  if (oChk.checked){
  location.href = "./file/" + oChk.value;
  setTimeout(function(){downloadAll(oFrm)}, 1000);
  }
  else{
  downloadAll(oFrm);
  }
  }
  }

  </script>

  <form id="test">
  <fieldset>
  <legend>다중 파일 다운로드</legend>
  <div>
  <input type="checkbox" name="file1" id="file1" value="/test.zip" />
  <label for="file1">test.zip</label>
  </div>
  <div>
  <input type="checkbox" name="file2" id="file2" value="/test2.zip" />
  <label for="file2">test2.zip</label>
  </div>
  <div>
  <input type="checkbox" name="file3" id="file3" value="/test3.zip" />
  <label for="file3">test3.zip</label>
  </div>
  <div>
  <input type="button" value="Download All" onclick="suffix=1;downloadAll(this.form);return false" />
  </div>
  </fieldset>
  </form>

댓글목록

등록된 댓글이 없습니다.

회원로그인

회원가입

Copyright © neion.co.kr All rights reserved.