1

I have a pretty wide-spreaded question .... I don't understand how Upload Progress Module works , and it kind of doesn't work for me too , so ....

1) I have installed nginx with all the upload modules (nginx, nginx-extras) , and php-fpm

2)This is part of my nginx config for the project:

    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)I followed the tutorial at the bottom of this page: http://wiki.nginx.org/HttpUploadProgressModule :

So i have a form and upload progress bar:

<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>

JS code that triggers the jquery script:

  <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>

And that script : https://github.com/drogus/jquery-upload-progress/blob/master/jquery.uploadProgress.js

Questions and Problems:

1)First problem is that i always get returned ({ "state" : "starting" }); ...

2)Second question is : the reason i began trying to make this thing work , is because i wanted to write a php script , which would slice file into chunks and send them to the server , so i could upload huge files , and have a progress bar to monitor it. But i couldn't even find the smallest example or tutorial how to get it done with php and upload_progress_module or w/e.

And no , i don't want flash based uploaders.

So i guess , you already understood that i am a confused. So if you could explain how i can get this done, and help solve the problem with already existing configuration would be great

2 Answers 2

1

action="index.html" doesn't look like the request that goes to location ~ \.php$.

Sign up to request clarification or add additional context in comments.

1 Comment

emm tha's a typo ... sorry ... i have it set in my file to test.php. Just copy pasted that part from the tutorial.
0

Not sure if you are still experiencing issues with this but see below for some solutions...

  1. No upload_pass value specified
  2. No upload_store specified
  3. Once specified an upload_store hashed directory needs to be created with correct permissions
  4. It would make more sense to add the action "/upload" to the form and send the form to this location on your upload domain (if different from the forms domain)
  5. I think that based on the 'starting' value of the json returned I would look at the directory issue in points 2 and 3 first
  6. The form needs to be passed to you upload location with a GET parameter of 'X-Progress-ID=[a custom upload id number]' so that it can track the status

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.