Click here to Skip to main content
15,901,666 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Awhile back I was given great advice about how to handle files by referencing them in the database instead of uploading the files as blobs. I am in the process of creating a genealogy database, however, there are a few things I have to work out. Today, I would like to start with my individual person directory. I have set up my code to create a directory based on the person's ID number when added to the database. What I am trying to figure out is should I link the directory path to the person's profile and show files in the directory or should I keep the file paths stored in the database? which way is better for design purposes?

What I have tried:

As of now I have my database set to use the file paths. This method has worked fine, however, Since there will be multiple types of files and folder(directories) related to one individual I was unsure if the file method would be sufficient enough.
Posted
Updated 27-Apr-18 18:53pm

1 solution

I would do the following :
In my app data folder say on d:\myapp\data
Create a Persons folder and in it a <id> folder for each person in my database i.e. d:\myapp\data\Persons\1234
Into which I would save any files and directory structure I need e.g. :
d:\myapp\data\Persons\1234
                        |-InfoFolder
                        |      |-file1.doc
                        |      
                        |-SomeOtherFolder

And store the relative files paths in my database i.e InfoFolder\file1.doc , SomeOtherFolder\filexyz.doc
 
Share this answer
 
Comments
Member 11856456 29-Apr-18 0:12am    
So the way I understand it. have a folder in my application called individuals. Within this folder store other directories for each individual. For instance, d:\myapp\data\Persons\1
d:\myapp\data\Persons\2
d:\myapp\data\Persons\3 ....etc

then create another directory within 1,2,3 called an infofolder where I would place documents into and store their pathways into the database.

Could I just make a d:\myapp\data\Persons\1...etc and store related documents in it and then store the paths into a database?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900