1 2 Previous Next 19 Replies Latest reply on Dec 21, 2013 10:31 AM by philmodjunk

    Container options

    EP

      Title

      Container options

      Post

           I store my container files externally on the FM server.  I'm building a portal that displays all uploaded files related to a contact.  Is there any way to be able to view/open .pdf's without having to "export field contents"?  I really don't want each user to download files on their computer just bc they simply needed to view a file, hence the reason I use secure storage.

        • 1. Re: Container options
          philmodjunk

               You'll need to use export field contents if you need to open the file in the client computer's default application. You can minimize the hassle if you download the file to the user's temporary items folder--which can be scripted so that all the user does is click a button to see the file open.

          • 2. Re: Container options
            EP

                 Perfect!

                 My Script is attached.  Works on my Mac, now have to test on Win.

                  

            • 3. Re: Container options
              philmodjunk

                   But that won't export to the Temporary folder. It's exporting to the same folder as where you have located your file. You need to combine the text in $TPath and $Name to use with the Export step.

                   I am assuming here that this is not FileMaker Go on an iOS device...

              • 4. Re: Container options
                EP

                     Not sure I understand.  For some reason, the path doesn't appear in the script window.  But here is my export path.

                      

                • 5. Re: Container options
                  philmodjunk

                       Ok, that's the missing info I couldn't see in your script though I don't think you need the / here. A / should be the last character returned by Get ( TemporaryPath). But if you aren't getting an error when you test the script...

                  • 6. Re: Container options
                    EP

                         I actually get an error that the path couldn't be created without the  / .  It works with it there.

                         Is there a way to test that the file is saving to the temp path on my computer?  FYI- This is a remote connection to FMS.  i just want to make sure the file is saved somewhere discreet and deleted upon the user exiting their FM client.

                    • 7. Re: Container options
                      philmodjunk

                           The file is saved to the client's computer. You can use a file found at this thread: Exploring the use of a $Path Variable in Scripts

                           To see the actual path to your temporary folder. I would think that you can use that file path to see the contents of the folder--but it may take some doing to get around the "hide flags" that keep the folder from being accessible.

                      • 8. Re: Container options
                        EP

                             Thanks.  Any idea why I can't create new directories on the server?

                        • 9. Re: Container options
                          philmodjunk

                               Do you have the file open with a full access password?

                          • 10. Re: Container options
                            EP

                                 Yes I do.  I am connected remotely.

                            • 11. Re: Container options
                              philmodjunk

                                   Hmm that was my last guess. Don't know why you are seeing this.

                              • 12. Re: Container options
                                EP

                                     I guess I'll just use the default directory listed (contacts).  Doesn't matter in the end I guess.

                                     On a side note, my script isn't working on a Win client.  The script runs, but the file never opens. (I see the exporting box pop up briefly).  Anything special I have to do for Windows?

                                • 13. Re: Container options
                                  philmodjunk

                                       Not that I know of.

                                       But I generally use only one $Path variable in the specify file window instead of two. I combine the path and file name text in one variable. Don't know if that will make a difference or not here.

                                  • 14. Re: Container options
                                    EP

                                         Figured out the issue. Windows needs a specific file extension in the filename to open the file and Mac doesn't.  Since various file types will be stored in this container field, I couldn't just name the file "xxx.PDF".  Instead I made a calc field:

                                         filename= substitute (getvalue (filecontainer; 1); "remote:" ; "")

                                         this gets the actual filename that's in the container.  Now files open on Windows.  

                                         My only concern- is there any chance this script will ever fail to work? I hardly ever worked with external container files and the container file was returning "Remote: filename.xx" as the path and name.  Since my solution is on a server, will that path ALWAYS be the same? Bc if not, this script isn't going to work properly.

                                         Thanks.

                                    1 2 Previous Next