3

Nginx Upload を Python (Tornado) で正常に動作するようにしました。アップロードしたファイルのパスをデータベースに保存します。

しかし、アップロード モジュールがアップロードを分割して 10 個の異なるフォルダーに配置する必要があるのはなぜ/var/www/.../uploads/0,1,2,3,4,5...9でしょうか? 以下のコメントは、ファイルがハッシュされたと言っていますが、モジュールがこれを行う理由と理由は何ですか?

  # 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;
4

1 に答える 1

2
# 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

ソース: http://bclennox.com/extremely-large-file-uploads-with-nginx-passenger-rails-and-jquery

于 2013-04-03T13:03:42.083 に答える