Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8288601
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:18:49+00:00 2026-06-08T12:18:49+00:00

when i upload a file with nginx upload progress module file starts uploading normally

  • 0

when i upload a file with nginx upload progress module file starts uploading normally , then i get the progress how much is uploaded , but when the file upload finishes i get error (({ "state" : "error", "status" : 17523466568084 });)

Well , my wild guess is that in my config is specified backend upload_pass /upload; , which i don’t have , and everytime it uploads file at the end it tries to get this backend and gives me error as it doesn’t exist. I tried to comment out this line , but then i get another error from nginx ( “track_uploads” directive track_upload should be the last directive in the location, after either proxy_pass or fastcgi_pass in /etc/nginx/sites-enabled/web-files.com:52).

1)So the first question is what’s the error ?

2)Second is how can i get those parameters passed from nginx to backend in backend.

Maybe someone has any ideas what’s the matter.

My nginx conf:

http {
   ...
   upload_progress upload 2m;

server {

    listen 80;
    server_name   mydomain;

    root /home/cha0s/web-files;
    index index.php;

    location ~ \.php$ {
      include /etc/nginx/fastcgi_params;
      fastcgi_pass 127.0.0.1:9000;
      fastcgi_param SCRIPT_FILENAME /home/cha0s/web-files$fastcgi_script_name;
      fastcgi_param PATH_INFO $fastcgi_script_name;

    }

    location ~ ^/files/(.*)$ {
            alias /home/cha0s/$1;
            internal;
    }

    location = /upload/share {
      client_max_body_size 250m;

      #Specify backend location/url and directory for file upload
      upload_pass /upload;
      upload_store /tmp;

      # Declare variables which are passed to backend
      upload_set_form_field $upload_field_name.name "$upload_file_name";
      upload_set_form_field $upload_field_name.content_type "$upload_content_type";
      upload_set_form_field $upload_field_name.path "$upload_tmp_path";

      upload_aggregate_form_field "$upload_field_name.md5" "$upload_file_md5";
      upload_aggregate_form_field "$upload_field_name.size" "$upload_file_size";


      # Delete uploaded file on error
      upload_cleanup 400 404 499 500-505;

      # Limit upload speed
      upload_limit_rate 8k;


      track_uploads upload 1m;
    }

    location = /upload/status {
      report_uploads upload;
    }

}
}

My test.php:

<!doctype html>
<html lang="ru">
  <head>
    <meta charset="utf-8">
    <script>
      function add() {
        if (parseInt(document.getElementById('count').getAttribute('value')) < 8) {
          var input = document.createElement('input');
          input.setAttribute('type','file');
          input.setAttribute('multiple','');
          input.setAttribute('name','file[]');
          document.getElementById('multiple').appendChild(input);
          document.getElementById('multiple').appendChild(document.createElement('br'));
          document.getElementById('count').setAttribute('value',parseInt(document.getElementById('count').getAttribute('value'))+1);
        }
        else {
          alert('Можно загрузить не более 8 файлов за раз.');
        }
      }
      function progress() {
        var ms = new Date().getTime() / 1000;
        rq = 0;
        id = "";
        for (i = 0; i < 32; i++) {
          id += Math.floor(Math.random() * 16).toString(16);
        }
        document.getElementById('upload').action = "/upload/share?X-Progress-ID=" + id;
        document.getElementById('status').style.display = 'block'
        interval = window.setInterval(function () { fetch(id, ms); }, 1000);
        return true;
      }
      function fetch(id, ms) {
        var fetch = new XMLHttpRequest();
        fetch.open("GET", "/upload/status", 1);
        fetch.setRequestHeader("X-Progress-ID", id);
        fetch.onreadystatechange = function () {
          if (fetch.readyState == 4) {
            if (fetch.status == 200) {
              var now = new Date().getTime() / 1000;
              var upload = eval(fetch.responseText);
              if (upload.state == 'uploading') {
                var diff = upload.size - upload.received;
                var rate = upload.received / upload.size;
                var elapsed = now - ms;
                var speed = upload.received - rq; rq = upload.received;
                var remaining = (upload.size - upload.received) / speed;
                var uReceived = parseInt(upload.received) + ' bytes';
                var uDiff = parseInt(diff) + ' bytes';
                var tTotal = parseInt(elapsed + remaining) + ' secs';
                var tElapsed = parseInt(elapsed) + ' secs';
                var tRemaining = parseInt(remaining) + ' secs';
                var percent = Math.round(100*rate) + '%';
                var uSpeed = speed + ' bytes/sec';
                document.getElementById('length').firstChild.nodeValue = parseInt(upload.size) + ' bytes';
                document.getElementById('sent').firstChild.nodeValue = uReceived;
                document.getElementById('offset').firstChild.nodeValue = uDiff;
                document.getElementById('total').firstChild.nodeValue = tTotal;
                document.getElementById('elapsed').firstChild.nodeValue = tElapsed;
                document.getElementById('remaining').firstChild.nodeValue = tRemaining;
                document.getElementById('speed').firstChild.nodeValue = uSpeed;
                document.getElementById('bar').firstChild.nodeValue = percent;
                document.getElementById('bar').style.width = percent
              }
              else {
                window.clearTimeout(interval);
              }
            }
          }
        }
        fetch.send(null);
      }
    </script>
  </head>
  <body>
    <form method="post" enctype="multipart/form-data" id="upload" onsubmit="progress();">
      <input type="hidden" id="count" value="1" />
      <div id="multiple">
        <input type="file" name="file[]" multiple /><br>
      </div>
      <input type="submit">
      <a href="#" onclick="add();">add();</a>
    </form>
    <div id="status" style="display: none;">
      <table width="100%"> 
        <tr><th></th><th>загрузка</th><th>осталось</th><th>всего</th></tr>
        <tr><td>время:</td><td id="elapsed">∞</td><td id="remaining">∞</td><td id="total">∞</td></tr>
        <tr><td>размер:</td><td id="sent">0 b</td><td id="offset">0 b</td><td id="length">0 b</td></tr>
        <tr><td>скорость:</td><td id="speed">n/a</td></tr>
      </table>
      <div style="border: 1px solid #c0c0c0;">
        <div style="background: #c0c0c0; width: 0%; text-align: right;" id="bar">0%</div>
      </div>
      <a href="#" onclick="if (confirm('Вы точно хотите отменить загрузку?')) window.location = '/'" id="cancel">cancel_upload();</a>
    </div>
  </body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T12:18:50+00:00Added an answer on June 8, 2026 at 12:18 pm

    As we already discussed:
    upload_pass /upload.php;
    😉

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the upload module to write the uploaded file to disk as soon
I was trying to upload file(s) using PrototypeJs request method but I failed. The
I am using JSch library to upload file from sdcard to SFTP server but
i need to upload file with jquery. i now about uploadify plugin, but i
I am trying to upload a file via a form and then save in
Code successfully upload file when I remove jquery script codes and submit. But with
I currently upload to a webservice on an nginx server using the upload module
when upload the same file for the multiple times i am getting this error......
I set a nginx server and trying to upload a file which is 500M.
My site uses nginx. I use apache only for large file uploading to the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.