CMS > Files

S

shapper

Hello,

I am creating a simple CMS for a web site.

The web site will hold many documents and for that I created Documents
table which holds information on each document such as:

Title, Description, Author, Url, ...

I would need to create the following functionalities:

1. Create a document and upload its file

2. Edit a document information and maybe change the file associated
with it.

3. Delete a document record (info) and the file associated to it.

How should I do this?

Should I separate the create a document and upload a document (file)?

Maybe I should have a table with all files and every time I upload a
file I would add a record to that table.

And then when I create a document I would insert its information and
select one of the uploaded files.

Anyway, what is usually the best way to do this?

I think that having everything integrating would be better but I am
not sure the way to go.

Thanks,

Miguel
 
G

Guest

Hello,

I am creating a simple CMS for a web site.

The web site will hold many documents and for that I created Documents
table which holds information on each document such as:

Title, Description, Author, Url, ...

I would need to create the following functionalities:

1. Create a document and upload its file

2. Edit a document information and maybe change the file associated
with it.

3. Delete a document record (info) and the file associated to it.

How should I do this?

Should I separate the create a document and upload a document (file)?

Maybe I should have a table with all files and every time I upload a
file I would add a record to that table.

And then when I create a document I would insert its information and
select one of the uploaded files.

Anyway, what is usually the best way to do this?

I think that having everything integrating would be better but I am
not sure the way to go.

Thanks,

Miguel

I would suggest a "table" way
 
R

Rob Meade

...
Should I separate the create a document and upload a document (file)?

I wrote a document management application for work, the approach I took was
that you create a "virtual" document in your database, storing an id, title,
publication date, review date, obsolete date, owner, etc etc, and then you
upload the file. I saved the file to our storage area with a unique id from
the database (from the files table), for example 1.doc, 2.pdf etc etc,the
database ties the files to the documents. With this approach, if you wanted
to give a URL to a document you could ensure that they always received the
most recent version of the document with having to change the URL for
example: download.aspx?docid=nnn, when this is requested it can then look up
the most recently attached file. As you upload each new file (version) you
just flag it as the most recent version and shuffle the others down
effectively.

To answer your numbers questions..

1. As above

2. I gave the ability to display a form which also had the "Browse" file
select box, but if they didn't choose a file it was the determined that they
were just updating the virtual document details, for example updating the
owner, or publication date, or a typo, but there was no need to add another
file. If they did add another file then it assumed a new version and would
shuffle the others down accordingly...

3. I chose to never delete anything, we flag the virtual documents/files
as deleted in the database and dont return them in the search results, but
we never delete the data or files, I work for the NHS (National Health
Service/UK) - and there maybe a legal reason why we may need to produce a
document in the future etc.
Maybe I should have a table with all files and every time I upload a
file I would add a record to that table.

Thats what I did..
And then when I create a document I would insert its information and
select one of the uploaded files.
Yep..

Anyway, what is usually the best way to do this?

Thats worked for us for the last 4 years, currently have around 5000+
documents stored, user base in the thousands...

Regards

Rob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,265
Messages
2,571,069
Members
48,771
Latest member
ElysaD

Latest Threads

Top