I have made the Nginx Upload working normally with Python (Tornado). I save the paths of the uploaded files in the database.
However, I wonder why the upload module has to split my uploads and put them into 10 different folders /var/www/.../uploads/0,1,2,3,4,5...9
? The comment below says the files were hashed, what and why the module does this?
# Store files to this directory
# The directory is hashed, subdirectories 0 1 2 3 4 5 6 7 8 9 should exist
upload_store /var/www/...uploads 1;
# filesystem location where we store uploads
#
# The second argument is the level of "hashing" that nginx will perform
# on the filenames before storing them to the filesystem. I can't find
# any documentation online, so as an example, say we were using this
# configuration:
#
# upload_store /tmp/uploads 2 1;
#
# A file named '43829042' would be written to this path:
#
# /tmp/uploads/42/0/43829042
#
# I hope that's clear enough. The argument is required and must be
# greater than 0. You can see the implementation here:
#
# http://lxr.evanmiller.org/http/source/core/ngx_file.c#L118
Source: http://bclennox.com/extremely-large-file-uploads-with-nginx-passenger-rails-and-jquery
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With