3 Replies Latest reply on Jun 10, 2014 6:35 AM by hjgunn@mmedia.is

    Importing files into containers when using Webdirect


      I've come to a point where I can drag and drop single files into container fields being displayed in Webdirect.

      I can also right click on a container field and import one file into the field I clicked on.

      And I know I could zip multiple files before uploading them.

      And I know there are various limitations when using Webdirect


      I was however wondering if there is a way to:


      Click on a button being displayed in Webdirect and start a script that:

      Opens a Get file dialog

      Allows the user to select one or more files

      Stores the path to the selected files in a variable

      Place the names of the selected files in a list

      Loop through the list

      Place each file in the list in a seperate record containing a container field


      I'm doing similar things in FM without problems, using a plugin, but is it possible and what would it take to do this in WebDirect.




        • 1. Re: Importing files into containers when using Webdirect

          You can not select multiple files for insertion to a container field in any version of filemaker, so your entire process is redundant. You've noted you've bypassed this on the desktop with a plugin, I'm assuming troi file or MBS. WebDirect will probably not likely support client-side plugins anytime soon.


          What you could possibly do is:


          Set Variable [ $id ; parenttable::primarykey ]

          Go To Layout [ containertable ]


             New Record

            set field [ containertable::foreignkey ; $id ]

            Insert File [ containertable::containerfield ]

             Exit Loop If [ get(lasterror) = 1 ]  //IE if user cancelled insert file

          End Loop

          If [ IsEmpty (containertable::containerfield) ]

             Delete Record, no dialog //Removes the last blank record.

          End If

          Go To Layout [ original layout ]


          The above would allow you to create a loop to add multiple files to a related parent record, but it's still within the confines of the "one at a time" FM file selection.


          Of course, the above could be made a lot more elegant with more error checking and a better loop process, but it's just a basic idea.

          • 2. Re: Importing files into containers when using Webdirect

            You could upload a ZIP file and use a plugin on the Server to export, parse names, unzip, and then read in one at a time... using insertFrom URL file:\\\filenameHere.ext

            • 3. Re: Importing files into containers when using Webdirect

              Thank you guys


              The client had asked for adding multiple files from a file dialog so I wanted to make sure I wasn't overlooking anything when I told him that this method is not an option.


              I will be telling them to zip larger sets of files while smaller numbers may be dragged into a portal list of related container fields.


              On the local end I will be using FM client anyway so there I can play around a bit more with options.


              And I'm using the BE plugin on the client side at this time.


              Kind regards