5 Replies Latest reply on Jul 26, 2012 3:10 PM by karendweaver

    Import Picture and rename




      I want to drag a picture to a container field in FM 12 and then have it renamed and stored on the server. Is that possible?



        • 1. Re: Import Picture and rename
          Stephen Huston

          You could set a script triggered onModified for the field which would export the file from the container field with a file name determined by the data. You might have to use some scripting which including commiting the record, and then doing the export to be sure the "modified" container field data has time to exist after the "modification" of the field before exporting that container data.


          Keep in mind that exporting to a server location has been problematic, requiring  that permissions and file paths are readable by FM Server, and you will still have  those issues to deal with when choosing where to save the image file.


          And that is also  separate from the container-data storage issues which have been discussed at length in other threads since 12's release.

          • 2. Re: Import Picture and rename

            I was thinking a batch change server script.  I dont know how to the the file path from the container thou.

            • 3. Re: Import Picture and rename
              Stephen Huston

              Please describe what you want the script to do. I am not clear about how you want to "batch" drag and drop, which is, by definition, a single record action.

              • 4. Re: Import Picture and rename

                Hi, the project changed a bit.  I was able to batch import the files.  Using script master and Insert from URL.  However the client want to rename the files so they can be searched for by other applications.  I want to COPY the file from the Filemaker server folder to Another folder and RENAME the file.  I do not care if there is a missing file link or file not found error.  I will delete the Photo records once the are moved.


                Thanks in advance,


                • 5. Re: Import Picture and rename

                  Hi Oreste


                  Have you tried "export field contents" script step?  You can name the file and export to a path.  You will need to have permissions to the path folder you are exporting to.


                  You can set up a looping script that exports the picture with the new name, test to be sure there was no error and the file exists, and then delete the original record, if you want.


                  After you have moved a file, you can reimport it with the correct file name and test for errors to be sure the file is where it is supposed to be with the name you gave it.  If you pass the test, then delete the record.