reset password
Author Message
jason1353
Posts: 12
Posted 15:46 Apr 29, 2010 |

I have this seemingly simple question: each page could have several files attached to it, and technically files could be used in more than one page. true? so when a user wants to put a new file in her page should the system first search for a file with the same path in the database and then let the new path be recorded or we should make a path column as unique in the Files table? or we should make a unique path for each file from the beginning?

Thanks

cysun
Posts: 2935
Posted 16:05 Apr 29, 2010 |

A page may have multiple file attachments, but a file attachment is only associated with one page,

Every uploaded file is considered a new file. If a user wants to "reuse" an already uploaded file, the user can embed a link to the file, e.g. /download.html?fileId=####, but note that in this case it's simply a hyperlink, not a file attachment.

The database schema is up to you.

 

cysun
Posts: 2935
Posted 07:09 May 05, 2010 |
cysun wrote:

A page may have multiple file attachments, but a file attachment is only associated with one page,

Every uploaded file is considered a new file. If a user wants to "reuse" an already uploaded file, the user can embed a link to the file, e.g. /download.html?fileId=####, but note that in this case it's simply a hyperlink, not a file attachment.

The database schema is up to you.

I think I need to clarify this. A file may be associated with only one page, but it could be associated with multiple revisions; otherwise creating a new revision of a page would require re-uploading all the files, which would be terribly tedious.