>  Q&A  >  본문

javascript - ajaxFileUpload 插件如何在前台限制图片上传大小

ajaxFileUpload 插件如何在前台限制图片上传大小

大家讲道理大家讲道理2768일 전655

모든 응답(1)나는 대답할 것이다

  • PHP中文网

    PHP中文网2017-04-11 09:12:46

    
    <script type="text/javascript">
    function UploadCompleteClient(sender, args) {
      var filesize = args.get_fileSize();
      var fileId = args.get_fileId();
    
    
      var status = document.getElementById('AjaxFileUpload1_FileItemStatus_' + fileId);
    
      if (parseInt(filesize) > fileSizeLimit) {
    
        alert("file exceeds file size limit");
        if (status.innerText) {
          status.innerText = " file exceeds file size limit ";
        }
        if (status.textContent) {
          status.textContent = " file exceeds file size limit ";
        }
      }
    }
    </script>

    회신하다
    0
  • 취소회신하다