1 Reply Latest reply on Apr 9, 2010 11:44 AM by philmodjunk

    Copying a File using a Custom Script?



      Copying a File using a Custom Script?


      Asking the experts...


      I'm sure that this question will instantly prove that I'm a NEWBIE!

      I've search the Interweb, the FM KB and the forums, but I con't seem to find what I'm looking for.


      I'm thinking (ok, hoping) that I can write a custom script for the following action.


      Click on a button and...

      1) Launch the "File Open" dialogue box

      2) Allow the user to select a file (i.e. any text file)

      3) Copy that file to a newlocation

      4) Copy that file (from the new location) to a container file in my database and store it as a reference only


      Can this be done?


      Many Thanks!


        • 1. Re: Copying a File using a Custom Script?

          Your script could use insert file to temporarily insert the file into a container field (don't select store by reference). This can be a global field if you want.

          The next step would be to use Export Field Contents to export the file to it's desired new location.

          Then use Insert File again, this time to insert it by reference to insert it from the new location.


          You'll probably need to use a variable and some get functions to compute the path and file name of this file.