2013-10-16 1 views
0

Blueimp의 jQuery 파일 업로드 플러그인을 사용하고 있으며 작동하지 못했습니다. 나는 이것을 site에 사용하고 있습니다. 파일을 추가 할 수있는 것 같지만 '업로드 시작'을 클릭하면 '오류, 초과 할당량 :이 애플리케이션은 일시적으로 게재 할당량을 초과했습니다. 나중에 다시 시도하십시오'라는 메시지가 나타납니다. 이걸 본 사람 있어요?Blueimp jQuery 파일 업로드 플러그인 - '업로드 시작'을 클릭하면 할당량 초과 오류가 발생했습니다.

<form id="fileupload" action="//grk.co/test2/" method="POST" enctype="multipart/form-data"> 
     <!-- Redirect browsers with JavaScript disabled to the origin page --> 
     <noscript><input type="hidden" name="redirect" value="http://grk.co/test2/"></noscript> 
     <!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload --> 
     <div class="row fileupload-buttonbar"> 
      <div class="col-lg-7"> 
       <!-- The fileinput-button span is used to style the file input field as button --> 
       <span class="btn btn-success fileinput-button"> 
        <i class="glyphicon glyphicon-plus"></i> 
        <span>Add files...</span> 
        <input type="file" name="files[]" multiple> 
       </span> 
       <button type="submit" class="tiny success start"> 
        <i class="glyphicon glyphicon-upload"></i> 
        <span>Start upload</span> 
       </button> 
       <button type="reset" class="tiny secondary cancel"> 
        <i class="glyphicon glyphicon-ban-circle"></i> 
        <span>Cancel upload</span> 
       </button> 
       <button type="button" class="tiny alert delete"> 
        <i class="glyphicon glyphicon-trash"></i> 
        <span>Delete</span> 
       </button> 
       <input type="checkbox" class="toggle"> 
       <!-- The loading indicator is shown during file processing --> 
       <span class="fileupload-loading"></span> 
      </div> 
      <!-- The global progress information --> 
      <div class="col-lg-5 fileupload-progress fade"> 
       <!-- The global progress bar --> 
       <div class="progress progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100"> 
        <div class="progress-bar progress-bar-success" style="width:0%;"></div> 
       </div> 
       <!-- The extended global progress information --> 
       <div class="progress-extended">&nbsp;</div> 
      </div> 
     </div> 
     <!-- The table listing the files available for upload/download --> 
     <table role="presentation" class="table table-striped"><tbody class="files"></tbody></table> 
    </form> 

그리고 내 JS : 사람이 아무 잘못을 발견 할 수있는 경우

<script> 
/*jslint unparam: true */ 
/*global window, $ */ 
$(function() { 
    'use strict'; 
    // Change this to the location of your server-side upload handler: 
    var url = window.location.hostname === '91.208.99.4' ? 
       '//grk.co/test2/' : 'server/php/'; 
    $('#fileupload').fileupload({ 
     url: url, 
     dataType: 'json', 
     done: function (e, data) { 
      $.each(data.result.files, function (index, file) { 
       $('<p/>').text(file.name).appendTo('#files'); 
      }); 
     }, 
     progressall: function (e, data) { 
      var progress = parseInt(data.loaded/data.total * 100, 10); 
      $('#progress .progress-bar').css(
       'width', 
       progress + '%' 
      ); 
     } 
    }).prop('disabled', !$.support.fileInput) 
     .parent().addClass($.support.fileInput ? undefined : 'disabled'); 
}); 
</script> 

, 나는 그것을 대단히 감사하겠습니다

여기 내 HTML입니다. 나는 jQuery로 새로운 것이므로 뭔가를 놓친다.

더 많은 정보가 필요하면 알려 주시기 바랍니다.

+0

URL을 업데이트하지만 초과 할당량 페이지로 이동하는 대신 index.html로 리디렉션됩니다. 대신 어떤 URL을 사용해야하는지 잘 모르겠습니다. 분명히 내가하는 일을 모른다. 누군가 제발 도와 줘? –

답변

0

서버의 업로드 처리 스크립트는 어디에 있습니까? 현재 (연결된 샘플 페이지에서) 업로드 된 파일은 http://grk.co/test2/server/php/ (으)로 전송됩니다. 나는/server/php /가 기본적으로 blueimp 패키지와 함께 제공되기 때문에 이것이 원하는 것이 아니라고 추측하고있다. 자신 만의 업로드 처리 스크립트를 지적해야합니다.

+0

내 UploadHandler.php는 server/php /에 있습니다. 나는 지금 정확하게 js를 가리켰지만, 업로드 된 파일을 넣을 폴더를 가리 키도록 URL을 어디에서 변경했는지 알고 있습니까? 또한 진행률 표시 줄에는 아무런 효과가 없습니다. 업로드 된 파일은 폴더에 있지만 내가 원하는 폴더가 아닙니다. –

+0

업로드 된 파일이 저장되는 위치는 UploadHandler.php의 코드에 의해 제어됩니다. move_uploaded_file (foo, bar)을 찾으십시오. 막대는 파일이 이동되는 위치입니다. 진행 막대는 디버깅하기가 더 어렵습니다. 하지만 progressall : function (e, data) {}가 필요합니까? 나는 그것을 끝내고 쉼표 (comma : done)를 따라 가면서 시도해보고 무슨 일이 일어나는 지 살펴 보자. – jimb