3 Replies Latest reply on Oct 15, 2012 11:24 AM by philmodjunk

    Files storage in databases which are shared on network

    ShaikhAtta1238

      Title

      Files storage in databases which are shared on network

      Post

           Hello, 

                     I have some databases which are running on FM Server 11 and they have some container fields where users are uploading files, due to this the performance of speed of the database has gone very low. Can I use my Server Machine as a path for the files to be uploaded rather than letting the files upload in the database. how can it be done?

        • 1. Re: Files storage in databases which are shared on network
          philmodjunk

               Set up a shared directory on the server that your users can access directly. They will each need to be able to map/mount the drive with exactly the same file path. They will each need at least "read" access privileges to this directory and they will need "write" access in order to add files to it.

               As a test, move a file to the shared directory and then insert it with the "store a reference" option into a container field in your hosted database. Then check from each client machine to make sure they can see the file in the container field and access it.

               Once that works, it's possible, if you want to make it more userfriendly to set up scripts to move the files into this new location and then re-insert them. You can also use a similar script so that a user can insert a file from their client machine and the script exports the file to the shared directory for them and then re-inserts it.

          • 2. Re: Files storage in databases which are shared on network
            ShaikhAtta1238

                 Thanks for the idea Phil, "if you want to make it more userfriendly to set up scripts to move the files into this new location and then re-insert them. You can also use a similar script so that a user can insert a file from their client machine and the script exports the file to the shared directory for them and then re-inserts it."

                 But kindly can you send me an example of the script please, because I am not have much familiar with this procedure.

            • 3. Re: Files storage in databases which are shared on network
              philmodjunk

                   Your script would look like this:

                   Insert File [Reference ; YourTable::YourContainerField]----> this script only works from a layout where YourContainerField is present on the layout
                   Set Variable [ $Filename ; Let ( [ T = GetasText ( Globals::gTempFile) ; L = Length ( T ) ]; Right ( T ; L - Position ( T ; "/" ; -1 ; L ) ) ) ]
                   Set Variable [ $Path ; value: "File: & /*put fully qualified file path to shared directory of files here*/ & "/" & $FileName ]
                   Export Field Contents [ YourTable::ContainerField ; $Path]
                   Insert File [ Reference ; YourTable::yourContainerField ; $Path]

                   Note, final step can be Insert Picture or any of the other Insert menu options. Select what's appropriate for your file type. You can even add code that checks the file extension of $FileName to use different insert steps for different file types.