Perhaps setting $Path from container may be the problem.
If you use latest FM14, use GetContainerAttribute(container; "externalfiles")
Other than there is no stable way is there. GetAsText ( container ) returns various result, having relative/absolute paths with image size, etc.
The container fields were created without option for external storage, all pictures used in the database are stored externaly.
This part is confusing. Containers can be set to be stored externally and you say they are not. But then you say that pictures are stored externally. Do you mean "by reference"?
The script picture you posted does not paint the complete picture, it cuts off the part where the $path variable is set.
The FM Inventory table was created by importing the table data from the Access 2013 equivalent Inventory table. The Access table did not have container fields, it did have two pathname fields which were used by Access 2013 to display two pictures for each record. The pathname (PC) used "\\Des07-HP\UniqueDB\Wood\sys\sys002-a.jpg", the script that I used first, takes the PC pathname and changes it to "imagemac/UniqueDB/Wood/sys/sys002-a.jpg", then the Global variable ($NPath) is set to the new pathname and next I Insert the picture that is specified in $NPath. Each record has two pictures so the script inserts;
"imagemac/UniqueDB/Wood/sys/sys002-a.jpg" and "imagemac/UniqueDB/Wood/sys/sys002-b.jpg".
The text in Bold is the external hard drive that has all of the photos used by the FM database
once you have inserted the pictures they now live inside the FM file, not on that external drive anymore - as far as the database is concerned.
Unless you used "insert reference only"?
There were no options in the script that set "insert reference only" so all of the images are embedded in the database.
I would like to set the container field storage options to store container data externally using;
- Store container data externally [database location]/Files/Container/
- Open storage
I would like the container field directory to be created in a location other that the local drive [database location]. Can this be done , if so how do I do it?
Yes it can be done. What version of FileMaker Server are you using?
Don't expect to be able to save the container files on a network share though, if that is what you are after.
The database is on a workstation not on a server and there are 3 other workstations that access the main DB remotely. The main database system has a 3TB hard drive for the pictures, this is /UniqueDB/Wood and is not a network share.
I think there are a couple of points worth making:
1. The "insert reference only" option has nothing to do with external storage, in fact if you choose this option it will override external storage. This option derives from before external storage was added, and should NOT be checked if using external storage.
2. If you use external storage, FM will make a copy of the item and store it according to the settings you choose. To access the container within your database, you do not use any file reference, you just reference the field itself, as you would any other related field.