1 2 3 Previous Next 32 Replies Latest reply on Oct 24, 2015 5:40 AM by user19752

    How to "insert file" on Filemaker Server

    mbeck65

      Hello everybody,

      in my application I would need to insert a file inside a container field but my application will run on Filemaker Server and, as we know, the "insert file" function is not supported on the FM Server...

      Has maybe someone found an alternative way to perform this action?

      I detail my need: I have a plugin that's able to create itself a new file on the FM Server; when it happens I would be able to automatically put this file inside a container field of the database handled by the FM Server.

       

      All your ideas and suggestions will be appreciated.

       

      Regards,

       

      Max

        • 1. Re: How to "insert file" on Filemaker Server
          Markus Schneider

          not sure if I get it right - but You can add content to any field on Your client, doesn't matter if the files are local or hosted on FMS

          • 2. Re: How to "insert file" on Filemaker Server
            nicolai

            You can run FileMaker Pro client on the same server at the same time and script the file insertion. This is not recommended by FileMaker, so could be a short-term solution. Another drawback - you will need an extra licence for FileMaker Pro client

            • 3. Re: How to "insert file" on Filemaker Server
              mbeck65

              I'm not sure my first description is clear enougth and so I try to tell something more:

              I have written a plugin, triggered by actions on a client, that is able to create itself new files on another machine (in my case the same machine that hosts FM Server). When it happens, I should automatically insert this new file inside a container field, I mean that this operation hasn't to be done by handle from an operator (ie client) but by using a script. It means also that this operation has to be done on the Server (so I need to use the function "Perform script on Server") but the function "Insert file", that I would use if I was on the Client, cannot be used on the Server because it's not supported. Maybe am I wrong? If it's so tell me so that I can understand.

              Let me know if some other details could be useful, Markus, and, in any case, thanks a lot for yuor support.

              Regards,

              Max

              • 4. Re: How to "insert file" on Filemaker Server
                mbeck65

                Thanks Nicolai but this can't be my solution since my Clients have to work via web browser: all the machines that hosts Clients are PC with Ubuntu and FM doesn't work with Linux...

                I think I would need a custom function or a plugin (but in this case I'm not sure that I can interact with the database...) through which insert my file inside the container field.

                In any case thanks a lot for your suggestion.

                 

                Max

                • 5. Re: How to "insert file" on Filemaker Server
                  user19752

                  "insert from URL ( file: )" is supported on server.

                   

                  OTOH, if you can write plug in, why don't you write inserting file function?

                  ScriptMaster can do it. (but I didn't test on sever since not having server licence)

                  • 6. Re: How to "insert file" on Filemaker Server
                    monkeybreadsoftware

                    MBS Plugin has also tons of functions to read files.

                    Monkeybread Software - MBS Filemaker Plugin: Component: Files

                     

                    e.g. Files.ReadFile for a generic one.

                    Also specialized functions like Files.ReadJPEG and Files.ReadPDF which can calculate previews.

                    • 7. Re: How to "insert file" on Filemaker Server
                      nicolai

                      I meant the instance of FIleMaker Pro on the same workstation as the one hosting FileMaker Server. This has to be mac or PC. You can run Server and Pro on the same computer, although it is not recommended. Than you can run a script on the FileMaker Pro to insert the database hosted on FileMaker Server (on the same computer).

                      • 8. Re: How to "insert file" on Filemaker Server
                        mbeck65

                        Yes, Nicolai, in this way I know that it works but my need is different: the clients have to drive the triggering of file creation and next storage of the file inside the container field!

                        I can't foresee that this kind of operation can be done only on one machine namely the server: the application is client/server and every time any client starts a particular operation it's triggering the activity on server side. I don't know if my need is clear now.

                        • 9. Re: How to "insert file" on Filemaker Server
                          nicolai

                          So the question changes to how to do it in FIleMaker pro on the server without user interaction based on particular event.

                           

                          On PC you can run a powershell script on the background to monitor a folder and in the event of folder change assign an action, such as run VBS file to open FileMaker Pro and insert the file.

                           

                          On a mac you can use User Agent and run AppleScript to do the same. ( I have a feeling your server is on PC)

                          • 10. Re: How to "insert file" on Filemaker Server
                            justinc

                            I think that the 'insert from URL' might be your answer, as user19752 mentioned.  You would want to use the 'File' protocol version of it, to reference a local file from the OS.  The Filemaker Server has access to the Temp directory (see 'get(temporarypath)' function here) and the Documents directory (see 'get(documentspath)' function, e.g. '/HD/Users/JoeJoe/Documents/'). 

                             

                            So, I think you would want to have your plugin save whatever file it is creating to one of those paths, then use the 'insert from URL' step to reference those paths and the filename.  You would need to know the name of the file being created, of course, but I imagine that you do.  The URL would look something like:  file:///MacintoshHD/Users/justin/Documents/.

                             

                            Here's a Wikipedia article on the FILE protocol.

                             

                            OR, as others have suggested, use a plugin to insert the file from the server.  I Monkey Bread (as noted below), or I think Base Elements does it, too.

                             

                            - J

                            • 11. Re: How to "insert file" on Filemaker Server
                              ibrahim_bittar

                              Hi Max

                               

                              You can't do it using pure FileMaker Server. It's not supported.

                               

                              However, you can use a free plugin called ScriptMaster, which has a function to insert a file into a container field and it runs on server.

                               

                              I have created my own plugin using ScriptMaster. If you need it I'll be happy to share it with you.

                               

                              See this screenshot.

                               

                              Screenshot 2015-03-27 06.37.26.png

                              • 12. Re: How to "insert file" on Filemaker Server
                                MacEasy

                                Hi,

                                 

                                I remember at devcon someone showing how to do this,  I think it's the temporary file path that server can actually access.

                                The example was you upload an excel spreadsheet into a container field and then run "perform script on server" to export the document out of the container and use import, to import the records.  So that the import runs 100 times faster because it runs on server and not on client.

                                 

                                If you went to devcon I'm pretty sure what you want is in this speaker session. 

                                DevCon 2014: Developing with Perform Script on Server - Greg Lane

                                • 13. Re: How to "insert file" on Filemaker Server
                                  MikeWile

                                  I've been trying to do the same thing. I can put an Excel file on the server. I can use the Send Email to email the file from the server. I just can't pull the file into a container. I've set up the container and I'm using the URL from the screenshot.serverLocationBlur.png

                                  • 14. Re: How to "insert file" on Filemaker Server
                                    nicolai

                                    It looks like you are missing a drive letter, e.g. "C:" and there is unessessary "///" after "file:"

                                     

                                    Try:

                                     

                                    filewin:/C:/Program%Files/   etc...

                                    1 2 3 Previous Next