Code Monkey home page Code Monkey logo

Comments (11)

masterzen avatar masterzen commented on September 17, 2024

Can you send me privately by e-mail a full debug log of the upload (that requires to compile nginx with the --with-debug option and to setup the error log to debug level).
Also, please include your nginx config (or the relevant parts).
I believe it works fine with nginx 0.8 and 0.9 (but I didn't test 1.0).

from nginx-upload-progress-module.

benbender avatar benbender commented on September 17, 2024

Just as a hint - In my setup its working like a charm with 1.0 :)

from nginx-upload-progress-module.

bkuberek avatar bkuberek commented on September 17, 2024

Ok so it sounds like we have a problem on our end. Thanks for your reply. I will try to find sometime soon and do as requested. Thanks again.

from nginx-upload-progress-module.

bkuberek avatar bkuberek commented on September 17, 2024

I have just sent you an email. In the email I also mentioned that our Nginx server was recently upgraded to 1.0. Thanks again.

from nginx-upload-progress-module.

bkuberek avatar bkuberek commented on September 17, 2024

@benbender: It sounds like I may be not be configuring properly. Could you please shed some light and show me how you have done it?

Thanks

from nginx-upload-progress-module.

bkuberek avatar bkuberek commented on September 17, 2024

Here is an excerpt from the log. (I dont really know what you are looking for in the log but I thought it would save you from searching through the log file I sent you). This I believe to be the log lines while the file was being uploaded:

2011/04/27 16:18:31 [debug] 9892#0: http file cache loader
2011/04/27 16:18:31 [debug] 9892#0: walk tree "/tmp/nginx_proxy"
2011/04/27 16:18:31 [debug] 9892#0: tree name 1:"."
2011/04/27 16:18:31 [debug] 9892#0: tree name 3:"tmp"
2011/04/27 16:18:31 [debug] 9892#0: malloc: 0000000016C62FC0:21
2011/04/27 16:18:31 [debug] 9892#0: tree path "/tmp/nginx_proxy/tmp"
2011/04/27 16:18:31 [debug] 9892#0: tree enter dir "/tmp/nginx_proxy/tmp"
2011/04/27 16:18:31 [debug] 9892#0: walk tree "/tmp/nginx_proxy/tmp"
2011/04/27 16:18:31 [debug] 9892#0: tree name 1:"."
2011/04/27 16:18:31 [debug] 9892#0: tree name 2:".."
2011/04/27 16:18:31 [debug] 9892#0: tree name 2:".."
2011/04/27 16:18:31 [notice] 9892#0: http file cache: /tmp/nginx_proxy 0.000M, bsize: 4096
2011/04/27 16:18:31 [debug] 9890#0: timer delta: 10004
2011/04/27 16:18:31 [debug] 9890#0: event timer del: -1: 1303935511443
2011/04/27 16:18:31 [debug] 9890#0: http file cache expire
2011/04/27 16:18:31 [debug] 9890#0: malloc: 00000000170A7280:55
2011/04/27 16:18:31 [debug] 9890#0: http file cache size: 0
2011/04/27 16:18:31 [debug] 9890#0: event timer add: -1: 10000:1303935521447
2011/04/27 16:18:31 [debug] 9890#0: posted events 0000000000000000
2011/04/27 16:18:31 [debug] 9890#0: epoll timer: 10000
2011/04/27 16:18:31 [notice] 9885#0: signal 17 (SIGCHLD) received
2011/04/27 16:18:31 [notice] 9885#0: cache loader process 9892 exited with code 0
2011/04/27 16:18:31 [debug] 9885#0: wake up, sigio 0

from nginx-upload-progress-module.

benbender avatar benbender commented on September 17, 2024

Hmm, i'll give it a try :) I use mod_upload in conjunction with upload_progress module and upload_progress is only a fallback for legacy browsers in my setup. Newer browsers which are supporting the js file-api are handle progressbar completly in js.

The relevant config in nginx looks like this:
http {

...

upload_progress                 proxied 1M;

server {

...

location /upload {
    upload_pass                     @upload_handler;

    upload_store                    /var/uploads/incomplete 1;
    upload_state_store              /var/uploads/incomplete 1;
    upload_resumable                on;
    upload_limit_rate               10M;
    upload_tame_arrays              on;
    upload_pass_args                on;

    upload_add_header               Access-Control-Allow-Origin *;

    upload_store_access             user:rw group:rw all:r;

    upload_aggregate_form_field     count_files                                              "$upload_file_number";
    upload_set_form_field           $upload_field_name[$upload_file_number][name]            "$upload_file_name";
    upload_set_form_field           $upload_field_name[$upload_file_number][mime]            "$upload_content_type";
    upload_set_form_field           $upload_field_name[$upload_file_number][path]            "$upload_tmp_path";
    upload_aggregate_form_field     $upload_field_name[$upload_file_number][md5]             "$upload_file_md5";
    upload_aggregate_form_field     $upload_field_name[$upload_file_number][size]            "$upload_file_size";

    upload_pass_form_field          "^hash|user_id|folder_id|folder_name|upload$";
    upload_cleanup                  400 404 499 500-505;

    upload_progress_header          hash;
    track_uploads                   proxied 30s;
}

location @upload_handler {

handle uploaded file inside a php-script

}

location ^~ /progress {
    report_uploads                  proxied;
    upload_progress_header          hash;
    upload_progress_jsonp_output;
}

}
}

from nginx-upload-progress-module.

bkuberek avatar bkuberek commented on September 17, 2024

Thanks for the config above. I will compare to mine and see if making changes will get it working. Regarding XHR uploads, I find it a great idea, but in my case it won't work. XHR upload first loads the entire file into memory and sends it to the server as a string. This is ok for some files but not videos and large PDFs.

Thanks again for the help!

from nginx-upload-progress-module.

benbender avatar benbender commented on September 17, 2024

Not necessary. You can do sort of chunk uploads with the FileReader-Api. Take a look at:
https://github.com/blueimp/jQuery-File-Upload and the maxFileReaderSize-option.

Hope we'll get you on the right track :)

from nginx-upload-progress-module.

bkuberek avatar bkuberek commented on September 17, 2024

Very Interesting. One can never know enough. Thank you so much for the link. I will be implementing this in the next version of our app.

from nginx-upload-progress-module.

bkuberek avatar bkuberek commented on September 17, 2024

I figured it out! Sorry about the trouble.

Here is my mistake: The upload form was passing the X-Progress-ID as one of the form fields. As soon as I removed the hidden field and added X-Progress-ID into the action attribute of the form it worked.

<form id="upload-form-{{id}}" action="/_upload?X-Progress-ID={{id}}" method="post" enctype="multipart/form-data" target="uploadframe-{{id}}">

Thanks again!

from nginx-upload-progress-module.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.