나는 업로드 진행 모듈이 어떻게 작동하는지 이해하지 못한다. 그래서 나에게도 잘 작동하지 않는다. 그래서 ...Nginx 업로드 진행률 모듈
나는 모든 업로드 모듈 (의 nginx, nginx를-엑스트라)와 nginx를 설치 한1)와 PHP-FPM
2) 본 프로젝트에 대한 내의 nginx 설정의 일부입니다
location ~ \.php$ {
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME /home/cha0s/learnphp$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
track_uploads proxied 1m;
}
location ~ ^/files/(.*)$ {
alias /home/cha0s/$1;
internal;
}
location ^~ /progress {
# report uploads tracked in the 'proxied' zone
report_uploads proxied;
}
3)이 페이지의 하단에있는 자습서를 따랐습니다 : http://wiki.nginx.org/HttpUploadProgressModule :
그래서 난 형태를 가지고 진행 표시 줄을 업로드 :
<form id="upload" enctype="multipart/form-data" action="index.html" method="post">
<input name="file" type="file"/>
<input type="submit" value="Upload"/>
</form>
<div id="uploading">
<div id="progress" class="bar">
<div id="progressbar"> </div>
<div id="percents"></div>
</div>
</div>
JQuery와 스크립트 트리거
JS 코드 :
<script type="text/javascript">
$(document).ready(function(){
$('form').uploadProgress({
/* scripts locations for safari */
jqueryPath: "/static/js/jquery.js",
uploadProgressPath: "/static/js/jquery.uploadProgress.js",
/* function called each time bar is updated */
uploading: function(upload) {$('#percents').html(upload.percents+'%');},
/* selector or element that will be updated */
progressBar: "#progressbar",
/* progress reports url */
progressUrl: "/progress",
/* how often will bar be updated */
interval: 2000
}
});
</script>
그리고 그 스크립트를 https://github.com/drogus/jquery-upload-progress/blob/master/jquery.uploadProgress.js
질문과 문제 :
1) 첫 번째 문제 i 내가 항상 돌아온다. ({ "state": "starting"}); ...
2) 두 번째 질문은 내가이 작업을하기 시작한 이유는 파일을 슬라이스로 잘라 서버에 보내는 PHP 스크립트를 작성하려고했기 때문입니다. 거대한 파일을 업로드하고 진행률 막대를 모니터링하십시오. 하지만 나는 심지어 작은 예제 또는 튜토리얼을 PHP와 upload_progress_module 또는 w/e로 처리하는 방법을 찾을 수 없었다.
아니요, 저는 플래시 기반 업 로더를 원하지 않습니다.
그래서 나는 이미 혼란 스럽다고 생각합니다. 그래서 내가 어떻게 할 수 있는지 설명하고 이미 존재하는 구성으로 문제를 해결하는 데 도움이된다면
죄송합니다 ... 죄송합니다 ... 내 파일에서 test.php로 설정했습니다. 튜토리얼에서 붙여 넣은 부분 만 복사하십시오. – Viktor