Welcome! Log In Create A New Profile

Advanced

Nginx and uploads

August 28, 2012 05:57AM
Hello,

I am trying to upload files to Nginx and process them via itself.
I have compiled it with nginx_upload_module-2.2.0.

My config is the following:
server {
listen 80;
server_name example.com;
client_max_body_size 100m;

location / {
root /www;
autoindex on;
}
location /upload {
root /www;

if ($request_method = POST) {
upload_pass @test;
break;
}
upload_store /www/upload;
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.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";
upload_pass_form_field "^submit$|^description$";
upload_cleanup 400 404 499 500-505;
}

location @test {
proxy_pass http://example.com:8080;
}

}

server {
listen 8080;
server_name example.com;
location / {
root /www;
}
}

This works, but it saves my uploads with random number names like 0000000001 0000000002 0000000003 0000000004 0000000005 0000000006 0000000007 0045422062 0059512315.
I want to save them with the original name.
Remember, my @test backend is also Nginx and not something else.

Pls help.
Subject Author Posted

Nginx and uploads

w00t August 28, 2012 05:57AM

Re: Nginx and uploads

Ensiferous August 28, 2012 09:43AM

Re: Nginx and uploads

w00t August 28, 2012 11:02AM

Re: Nginx and uploads

Ensiferous August 29, 2012 12:51AM

Re: Nginx and uploads

VBart August 29, 2012 07:06AM

Re: Nginx and uploads

w00t August 30, 2012 06:30AM

Re: Nginx and uploads

agentzh August 30, 2012 03:14PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 89
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready