|
Posted by Shelly on 09/17/07 14:15
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@gmail.com> wrote in message
news:1190035565.874728.46600@50g2000hsm.googlegroups.com...
>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...@attglobal.net> 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...@attglobal.net
>> ==================
>
>
Navigation:
[Reply to this message]
|