Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

See also How are Images represented in the Model?, How to access images after changing the default namespace?

The uploaded image files are identified by a combination of URI and filename. The URI is used as the principal identifier so we don't need to worry about collisions if two people each upload an image named "image.jpg". The filename is retained so the user can use their browser to download their image from the system and it will be named as they expect it to be.

We wanted a way to store thousands of image files so they would not all be in the same directory. We took our inspiration from the PairTree folks ([, and modified their algorithm to suit our needs. The general idea is to store files in a multi-layer directory structure based on the URI assigned to the file.

...


Note

In this example, we assume that VIVO's home directory is at /usr/local/vivo.

We want to turn the URI into the directory path, but the URI contains prohibited characters. Using a PairTree-like character substitution, we might store it at this path:

...

By the way, almost all of this is implemented in edu.cornell.mannlib.vitro.webapp.filestorage.backend.FileStorageHelper
and illustrated in
edu.cornell.mannlib.vitro.webapp.filestorage.backend.FileStorageHelperTest

...

From a http://sourceforge.net/mailarchive/message.php?msg_id=26671929 message),] in the vivo-dev-all archive, by Jim Blake, dated 2010-11-29 18:56