ПРОЕКТЫ 


  АРХИВ 


Apache-Talk @lexa.ru 

Inet-Admins @info.east.ru 

Filmscanners @halftone.co.uk 

Security-alerts @yandex-team.ru 

nginx-ru @sysoev.ru 


  СТАТЬИ 


  ПЕРСОНАЛЬНОЕ 


  ПРОГРАММЫ 



ПИШИТЕ
ПИСЬМА












     АРХИВ :: nginx-ru
Nginx-ru mailing list archive (nginx-ru@sysoev.ru)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

upload_aggregate_form_field $upload_file_md5 н е работает


  • To: nginx-ru <nginx-ru@xxxxxxxxx>
  • Subject: upload_aggregate_form_field $upload_file_md5 н е работает
  • From: ash2k - <ash2kk@xxxxxxxxx>
  • Date: Wed, 31 Mar 2010 17:37:59 +0600
  • Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:received :message-id:subject:to:content-type:content-transfer-encoding; bh=NunadCoVG5KS8uBy5e7PNIZ6LrqRTv7giRUe64vYAow=; b=VA+2yssmio3moeqHyFk4iQdRtlUB88JaEpMppbswHKpxBqxtdhun0A7gyiVwqD2LOy vSi6UNlYjB2TaDL5Dfkj+8UJXPrikOyK2uWO9Kh9uCjlLeL4vk1pta/VwHBE0mz6ZFQX un+U6IgIgGlQy4NWMErloSPJvsS0mmZANd8gc=
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type :content-transfer-encoding; b=OMjYQvnQfSv5aTb5GSuwCB2QrKaHLFUdg4b3lOB2mG0Aecgo+/KLfYrEQPaflmaiZk LsPOTwtHXGJdHe1KMk+z1kdrPdqcdtpbqCPGYeoZySWDGfLh9wRJjJhGwCwLo0uhLtjD h4Y09Iacr9E9rjGX8CodoPn43xMhqfiqrE2Fg=

Здравствуйте! Подскажите пожалуйста почему так (не)работает следующая
конфигурация с модулем http_upload_module:

# nginx -V
nginx version: nginx/0.8.34
configure arguments: --prefix=/usr/local/etc/nginx --with-cc-opt='-I
/usr/local/include' --with-ld-opt='-L /usr/local/lib'
--conf-path=/usr/local/etc/nginx/nginx.conf
--sbin-path=/usr/local/sbin/nginx --pid-path=/var/run/nginx.pid
--error-log-path=/var/log/nginx-error.log --user=www --group=www
--add-module=/home/ash2k/ngx_http_secure_download
--http-client-body-temp-path=/var/tmp/nginx/client_body_temp
--http-proxy-temp-path=/var/tmp/nginx/proxy_temp
--http-fastcgi-temp-path=/var/tmp/nginx/fastcgi_temp
--http-log-path=/var/log/nginx-access.log --with-http_dav_module
--with-http_gzip_static_module
--add-module=/usr/ports/www/nginx-devel/work/nginx_mogilefs_module-1.0.3
--with-http_realip_module --with-http_stub_status_module
--add-module=/usr/ports/www/nginx-devel/work/nginx_upload_module-2.0.12
--add-module=/usr/ports/www/nginx-devel/work/nginx_uploadprogress_module-0.8
--add-module=/usr/ports/www/nginx-devel/work/ngx_http_upstream_keepalive-0.2
--add-module=/usr/ports/www/nginx-devel/work/mod_zip-1.1.5 --with-pcre

# uname -a
FreeBSD host.tld 8.0-STABLE FreeBSD 8.0-STABLE #0: Wed Feb 10 17:03:53
YEKT 2010    ......  i386

# cat ./nginx.conf
user                                    nginx;
worker_processes                        1;
error_log                               /var/log/nginx/error.log debug;
events
{
}
http
{
    include                             mime.types;
    default_type                        application/octet-stream;
    client_max_body_size                20m;
    sendfile                            on;
    keepalive_timeout                   65;
    server_names_hash_bucket_size       64;
    server_tokens                       off;
    reset_timedout_connection           on;
    access_log                          off;

    upload_progress                         app_uploads1 1m;
    upload_progress                         app_uploads2 1m;

    include                             app_upstreams.conf;
    include                             conf/*.conf;
}
# cat ./conf/app.conf
server {
        include                                 conf/app_static.inc;
        server_name                             host.ru;
        access_log                              /var/log/nginx/app.access.log;
        error_log
/var/log/nginx/app.error.log debug;

        location = /get-progress {
            upload_progress_content_type        application/json;
            upload_progress_template            starting
'{"state" : "starting"}';
            upload_progress_template            uploading
'{"state" : "uploading", "size" : $uploadprogress_length, "uploaded" :
$uploadprogress_received}';
            upload_progress_template            done
'{"state" : "done", "size" : $uploadprogress_length}';
            upload_progress_template            error
'{"state" : "error", "code" : $uploadprogress_status}';
            report_uploads                      app_uploads2;
        }

        location = /upload {
            client_max_body_size                1601m;
            upload_pass                         @upload;
            upload_store                        /tmp/uploads;
            upload_store_access                 user:rw group:rw all:rw;

            upload_set_form_field
$upload_field_name.name "$upload_file_name";
            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";

            upload_cleanup                      400-599;
            upload_buffer_size                  64k;
            upload_max_file_size                1600m;
            track_uploads                       app_uploads2 30s;
        }

        location @upload {
            root                                /home/app;
            include                             fastcgi_params;
            fastcgi_param                       SCRIPT_FILENAME
/home/app/enterpoint.php;
            fastcgi_pass                        app;
        }
}

в таком виде на бекэнд передается все как и предполагается (пхпшный
var_dump($_POST)):
array(2) {
  ["upfile_0_name"]=>
  string(36) "54a2d3e04647be2082f28602f501c031.jpg"
  ["upfile_0_path"]=>
  string(23) "/tmp/uploads/0062107219"
}
если раскомментировать строку
upload_aggregate_form_field "$upload_field_name.md5" "$upload_file_md5";
то получаю
array(0) {
}

В error логах никаких ошибок нет. В обоих случаях файл остается лежать
в /tmp/uploads/.
Строка upload_aggregate_form_field "$upload_field_name.size"
"$upload_file_size";
работает нормально - от её наличия или отсутствия поведение не
меняется, кроме передачи "upfile_0_size" в первом случае.
От объема файла не зависит.

Еще заметил что "$upload_field_name.name" становится "upfile_0_name" -
точка меняется на подчеркивание. Так должно быть?

_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://nginx.org/mailman/listinfo/nginx-ru


 




Copyright © Lexa Software, 1996-2009.