Welcome! Log In Create A New Profile

Advanced

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

ash2k -
March 31, 2010 07:40AM
Здравствуйте! Подскажите пожалуйста почему так (не)работает следующая
конфигурация с модулем 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@nginx.org
http://nginx.org/mailman/listinfo/nginx-ru
Subject Author Posted

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

ash2k - March 31, 2010 07:40AM

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

Alexander Bodnarashik March 31, 2010 08:30AM

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

ash2k - April 12, 2010 01:36AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 152
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready