select p.person_name, d.FileName
FROM tbl_people p, tbl_documentFile d
Where p.documentID = d.documentID
select c.company_name, d.FileName
FROM tbl_company c, tbl_documentFile d
Where c.documentID = d.documentID
In this case d.documentID could be 5 for the tbl_people as well as 5 for tbl_company. as a result the above queries would return the same file attachment
>It seems to me that you should definitely consider a seperate reference table for your files. Basically, just something simple like this:
>
>DocumentFile
>- DocumentFileID PK
>- DocumentID FK
>- FilePath text
>- FileName text (user friendly name)
>
>Which seems closest to 2.
>
>- Calvin
>
>
> ----- Original Message -----
> From: Dwayne Cole
> To: CF-Talk
> Sent: Monday, December 29, 2003 5:12 AM
> Subject: Struggle: Managing File & Image Attachments
>
>
> I had this problem for the last two years and I know I am ready for a better solutioins.
>
> In my CMS I would like to attached various images and other files to records in various tables. I'm considering 3 approaches and I would like some advice.
>
> Approach 1.
> Have an "image" and a "doc_attached" field in each table. (This is the approach that I'm currently using but I'm having problems because I am limited to 1 image and 1 attachment per record.
>
> Approach 2.
> Since file and documents form a one-to-many and even a many-to-many relationship. Store all images, and attachments in a seperate than go about the business of more complicated queries and more complicated data retrieve code.
>
> Approach 3.
> Create a "attach_wddx" field in each table then lump all attachments into a serialized query object. (this is approach that I've just switch to.
>
> The issues to manage are:
>
>
> Issue 1:
> The interface for adding a new attachment to a record is bulky and not very intuitive.
>
> Issue 2.
> How do a manage and coordinate the database reference to the file, where the physical file is stored and how to more efficient upload the the files.
>
> Issue 3.
> Since each attach file has a lable and description field. How do I edit the lable and description field with out having to delete and reupload the attachmente.
>
> I've considered just having a resource management use case, where the process of managing attachment resources (sound, video, flash, .doc etc) is centralized.
>
> Has anyone figured out a good approach to this issue.
> Dwayne Cole, MS in MIS, MBA
> Certified Advanced ColdFusion Developer
> 850-591-0212
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

