1 Reply Latest reply on Feb 1, 2013 8:21 AM by Mike_Mitchell

    Open files from container with safe storage

    noidpurity

      Hello,

       

      I have a database with a portal for attatchment with a container that has secure storage activated that's called "Bilagor::Bilaga" where it should be able to put both PDF, documents, and more.

      The problem is that I can't just double-click to open it, because I have to export the file first.

       

      But I don't know how, I have tried with the script below and also with the "button-function" "Export Field Contents".

       

      This is the script, but it did not work.

       

      SetVariable [$file_name; Value: "filewin:" &Get (TemporaryPath) & GetAsText (Bilagor::Bilaga)]

      Export Field Contents ["$file_name"; Auto Open]

       

      I don't know if the spelling is correct above, I have translated it from Swedish.

       

      Anyway, I get the following error: "remote: xxxxx.pdf" could not be created on this drive. Use a different name, free disk space, lock up the disk, or use another disk.

       

      Right now the script is in the "buttonconfig" for the field that also hold the file.

       

      Kind Regards,

      Noid

        • 1. Re: Open files from container with safe storage
          Mike_Mitchell

          Hello, Noid.

           

          I believe your difficulty is in using GetAsText directly as the filename. GetAsText returns more than just the filename when applied to a container field. This example is from the Help file:

           

          remote:cat.jpg
          size:320,240
          JPEG:Images/Animals/cat.jpg

           

          You'll need to parse out the filename from the results of GetAsText in order to get the result you need. I suggest using the Data Viewer on a few of your records to see what the GetAsText function is returning; that will give you a place to start.

           

          HTH

           

          Mike