Re: which is the better option for directory hashing to store large number of image files?



I didn't understand what you were asking at first, but I think I do now.
What I would do in your is to use a combination of file structure and
database entries. The first question you need to ask yourself is how will
you typically be accessing these files. For example, I store a list of
images for a given order. In that case, I create a folder under photos with
the name of the order number. I then place the images in that folder -- but
then I only plan to access it via order number. That is simple. What you
see to need is a multiple method of finding the files. They might be
between certain dates, certain owners, certain names, etc. In that case you
would want to put all those as fields in a database table and have the full
file name (including path) in another field. You would search the database
however you wish and that would yield [near] immediate access to the file
location.

Moral: Programming, as well as life, is not always an either-or. Sometimes
a compromise/hybrid is the best solution.

--
Shelly


"NoDude" <nodude@xxxxxxxxx> wrote in message
news:1190035565.874728.46600@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I personally use something like /images/front/controller/row_id/ -
that way I can only store the name of the image.

On Sep 17, 2:49 pm, Jerry Stuckle <jstuck...@xxxxxxxxxxxxx> wrote:
theCancerus wrote:
Hi All,

I am not sure if this is the right place to ask this question but i am
very sure you may have faced this problem, i have already found some
post related to this but not the answer i am looking for.

My problem is that i have to upload images and store them. I am using
filesystem for that.

setup is something like this, their will be items/groups/user each can
have upto 6 images which needs to be scaled to 4 different sizes ie
every item can have upto 24 images of varying sizes.

now the standard way of storing these files would be to store them in
subdirectories based on some hash.

my partial solution is to split the four types of files into four
fixed base folders for each dimension,

since filename is in format "YmdHis" i decided to use directory
structure as Y/m/d/<filename>.
but i realize that even this could be inefficient.

so now i am thinking about going one more level by creating Y/m/d/H/i/
<filename> directory structure.

now my question is how to go about creating subdirectories below base
folders, will my scheme hold or should i use md5 hash as suggested by
others, over the filename and then take 2-3 characters and create one
or two level of directory structure and then store the files?

Regards,
Amit

I use databases for this.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@xxxxxxxxxxxxx
==================




.



Relevant Pages

  • Re: How to Link a file instead of embeding in Access Table
    ... There will be multiple folder in time, but right now, I will ... visio drawing in the database. ... It's usually simpler just to store the names and locations ... Could I use that if I put a OLE ...
    (microsoft.public.access.externaldata)
  • Re: How to Link a file instead of embeding in Access Table
    ... I'd store the information about the network share ... separately from the folder and filename. ... It's probably worth taking a look at the DocMgr sample database here: ... Could I use that if I put a OLE ...
    (microsoft.public.access.externaldata)
  • Re: Storing images in postgreSQL (with PHP)
    ... > I am wanting to learn how to store images in a postgreSQL database. ... Some code to load a picture might be: ...
    (comp.lang.php)
  • Re: File Browse code
    ... path and filename into a field. ... would allow you to store a path and filename into seperate ... If you want to store a path and folder name then ... > normal windows folders (i.e. not in an Access Database). ...
    (microsoft.public.access.formscoding)
  • Re: storing path only to database
    ... Do not store the images in the file, rather store them on the hard drive and ... store the path to them in the Access database. ... Alternatively, you can store images in multiple tables, each one of which is ... Dim MyFolder As String ...
    (microsoft.public.access.formscoding)