After reading yesterday’s thread, I’m thinking that “Store container data externally” would be the best option for this. I changed the
storage option in the field definition, and selected the Open storage option. I’m unclear, however, on the steps I need to take on setting up the location for the files, and the paths in the script.
Sounds like you're thinking of the wrong thing...
You don't need paths in your script, except to where the file is that you want to insert (if you are not letting the user choose the file). That's before it ends up in the container and gets stored by FMS to the Remote Container Data path.
That RC data path is not something that you ever expose to you users, or use in your scripts.
Wim - Thanks for your reply - I follow you.
Right now the image files are on my HD, and the script goes there to place them, based on the choice mentioned in the OP.
I'm still not clear on my next steps, so that the script will place the right file properly when triggered by the user. Initially, there will be no records that have an image in the container field. One of five image files will be placed into the field by the user, by selecting a 1 - 5 choice in the number field mentioned above.
How do I change the script to accommodate the storage that FMP will set up, if I'm asking this correctly?
A couple of things. As Wim says, don't expose the open storage folder(s) to any users, any interaction with the files outside of FileMaker will end up breaking the links.
Use File:Manage:Containers to setup the base location for the main container folder, you have the option of having a separate folder from the database folders if you wish.
Each container field (in Options:Storage) enables you to select external storage and open storage. In the open storage options we enter Year ( Get ( CurrentHostTimestamp ) ) & "/" & Month ( Get ( CurrentHostTimestamp ) ) & "/" which creates a Year folder and 12 monthly sub folders within each RC folder to organise our files, this also ensures a single folder doesn't hold a huge number of files.
Once you've set this up, you can interact with your container fields any way you wish, FileMaker will do all the hard work for you.
Also read some of the backup comments elsewhere within the community postings.
Hope this helps