I am currently working on a database of reports and I need to store documents externally.
These reports are usually doc files, but can be also pdf, excel, power points... In the database there is a button for "uploading" the report file and a button for opening it from the database. The files are stored externally in a repository folder, which is not a problem in principle, except that I need the possibility of keeping not only the current version of the report, but also the older ones. With the "Open" button one goes to the current version of the report. Only the admins can have access to the repository folder.
Currently I am managing (successfully) the uploading of files in this way:
- each records stores the file name and in a global field is stored the folder path
- through a dialog the user chooses the file: this is copied in the repository folder and renamed, say to "name.doc";
- if a file "name.doc" is already present, this is copied and renamed to something like "name_old_date.doc"; then the new file is copied to "name.doc"
- these operations are handled by sending an event to cmd (Windows)
I am not using containers mainly because they cannot display .doc files.
Though the solution I found works, I recognise that it is not very robust and I have the feeling that it is not the "FileMaker way" to solve the problem, so I am looking for suggestions.
Keep in mind that in no way I want to store the files (only) internally because there must be the possibility to access them without the use of the database.