7 Replies Latest reply on Jul 10, 2015 2:14 PM by philmodjunk

    save pdf's to drop box

    weedonpaul

      Title

      save pdf's to drop box

      Post

      I am Writing a script to export a pdf to drop box, the problem I;m having is that as the fm file is stored on a server the drop box location path is different for each user. any ideas?

        • 1. Re: save pdf's to drop box
          schamblee

          On windows you would map the same drive letter (For Example S:) on all computer to the dropbox folder on there computer and use that as your path.    I don't think Mac has anything similar, so they would have to have the same location on their computers.

          Warning : You can end up with different version of the PDF files using this method, because dropbox will open multiply copies of files.  If two users open the same pdf at the same time and modify just one small item then dropbox will write both to different files. create conflict copies. 

          • 2. Re: save pdf's to drop box
            philmodjunk

            In most cases, I wouldn't expect the "multiple copies" issue to be a problem since these are PDF files being saved to drop box.

            An alternative approach that would work identically for Macs and Windows systems would be to set up a table with one record for each computer and use a text field in that table to store the correct file path for each computer. Get ( PersistentDevice ) comes to mind as a way to identify each computer.

            • 3. Re: save pdf's to drop box
              weedonpaul

              can i not save to a web address or use and ftp?

              • 4. Re: save pdf's to drop box
                philmodjunk

                Yes, this is possible, but not what you requested earlier.

                You should be able to use either Open URL or Insert From URL to do that as long as you can put together a URL expression that is compatible with the web site's API. Insert From URL can be handy if there is any kind of return "Result" that you need to capture and test such as a response that indicates a successful upload.

                • 5. Re: save pdf's to drop box
                  schamblee

                  Multiple copies shouldn't be a factor with PDFs unless they are editing the PDFs.  It is a issue to be aware of.

                  There have been recent reports on the community forum that the presistenID is not unique on different computers.  There have been more than one report on that forum.  Here is a link to one of them https://community.filemaker.com/message/183279#183279

                  • 6. Re: save pdf's to drop box
                    philmodjunk

                    But that should not be a problem with PDF's in most circumstances, a PDF is a file that is most often treated by users as a read only document. So this isn't likely to be a situation where different users would be opening the same PDF at the same time and editing it. That certainly is possible, however, so that's why I qualified that with "in most cases".

                    Good point on the get ( PersistentID ) issue. It's not yet been confirmed by a TS person. While I've seen such a report, I don't recall seeing it over in Report an Issue so maybe it hasn't yet been brought to their attention. But it's also not the only way to manage such a list of file paths if such turns out to be a useful option.

                    • 7. Re: save pdf's to drop box
                      philmodjunk

                      I decided to follow the "bread crumbs" here to be sure that there was an Issue Report in place. There is, but apparently the Persistent ID issue occurs very very rarely for most users and thus FMinc has had zero sucess in replicating the problem. It also appears to be a WIndows only issue so if you are using Macs, it would appear that Get ( PersistentID ) will work just fine.

                      For most of the issue report thread, it seem that the persistent ID issue was manageable as it appeared to return the same exact value each time if failed--which would make it possible to test for that one value and try again when detected. But then the very last report posted indicated that they were not getting this same value when the function failed....

                      There's another get function that grabs a value off the NIC that can probably work just fine here. Since it's not being used here as a security feature to prevent pirating the solution, any method that reliably returns a different value for each computer should be sufficient.