Nginx and uploads
w00t
nginx-forum at nginx.us
Tue Aug 28 09:57:55 UTC 2012
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.
Posted at Nginx Forum: http://forum.nginx.org/read.php?2,230184,230184#msg-230184
More information about the nginx
mailing list