6 Replies Latest reply on Oct 2, 2012 3:53 AM by Oliver_Reid

    OS X Server : Make externally stored files accessible to Web server ?

    Oliver_Reid

      My application's "Reports" table manages pdf reports stored in a container field using non secure external storage

       

      FMS will not accept a relative path for external storage that uses '....', of course.

       

      But can I make the storage location directly available to Apache so users can view and download them via a browser?

       

      I don't want to store mutiple copies of each pdf and it would be really helpful if I could delete pdfs that are obsolete via the Reports table.

       

      (Tried an alias to the storage folder placed in the WebServer folder -- did not work)

        • 1. Re: OS X Server : Make externally stored files accessible to Web server ?
          mbraendle

          Oliver,

           

          we do that for a large set of pdf files by linking the mounted volume to the web folder.

           

          For this, you have to create a symbolic link using the UNIX ln -s command.

           

          E.g.

           

          ln -s /Volumes/myvolume /Websites/yourwebfolder/.

           

          (type the . at the end of the directory)

           

          The directories and files on the mounted volume must have the correct permissions: directories: other = rx, files: other =  r.

          • 2. Re: OS X Server : Make externally stored files accessible to Web server ?
            Oliver_Reid

            Martin -- many thanks

             

            To make sure I get this right

             

            1 The pdfs are stored by a FMS hosted app "containers" in

             

            /Library/FileMaker Server/Data/Databases/RC_Data_FMS/containers/Files/containers/pdfs

             

            2 so I would

             

            navigate into a 'normal' web site folder, e.g., WebServer/Documents/myreports/

             

            3 Then open terminal and enter

             

            (there is only one disk drive)

             

            ln -s /Library/FileMaker Server/Data/Databases/RC_Data_FMS/containers/Files/containers/pdfs/.

             

            or should it be

             

            ln -s/Volumes/MacintoshHD/Library/FileMaker Server/Data/Databases/RC_Data_FMS/containers/Files/containers/pdfs/.    ?

             

             

            Then

             

            4 I make the pdfs directory r/w by everyone (Note a quick test suggests that FMS sets the file to 'Everyone r/w' when saving the container contents)

             

             

            5 then http://myippaddress/myreports/report.pdf   will diisplay the document in a browser when that document is

             

            MacintoshHD/Library/FileMaker Server/Data/Databases/RC_Data_FMS/containers/Files/containers/pdfs/report.pdf

             

            Have I understood?

             

            Oliver

             

            Message was edited by: Oliver_Reid

            • 3. Re: OS X Server : Make externally stored files accessible to Web server ?
              Oliver_Reid

              PS Should I escape the space thus

               

               

              Filemaker\ Server

              • 4. Re: OS X Server : Make externally stored files accessible to Web server ?
                Oliver_Reid

                Martin

                 

                I have tried hard, but could not get this to work

                 

                Would you be so kind as to prvide setp by step instcutions for a Unix command line novice?

                 

                Thanks

                • 5. Re: OS X Server : Make externally stored files accessible to Web server ?
                  mbraendle

                  Hmm. I rather thought these files were managed externally and not stored in a container field.

                   

                  Did you try to open a file in this path directly with Adobe Reader? I'm not sure whether these are managed by FMS and maybe even are encrypted.

                   

                  The ln -s command is

                   

                  ln -s source target

                   

                  i.e. source would be  /Library/FileMaker Server/Data/Databases/RC_Data_FMS/containers/Files/containers/pdfs/

                   

                  If you are in the web directory, target is "." (the alias then takes the directory name of the lowest-level directory of your source, in your case "pdfs"), or a chosen name, e.g. "myreports"

                  • 6. Re: OS X Server : Make externally stored files accessible to Web server ?
                    Oliver_Reid

                    Got this going and it all works

                     

                    Notes

                     

                    1 Select 'Open Storage' for the container field

                     

                    2 In OS X 10.6 Server the Terminal did not like the '.'  -- I had to provide a specific name for the link

                     

                    3 Make sure the account you are logged in as can write to the Webserver/Documents folder

                     

                    4 I am not certain, but I think executing the ln command changed the permissions on the container storage directory so fsadmin could only read from it. I fixed that and also added 'Everyone rw'

                     

                     

                     

                    5 The symbolic link works, an ordinary OS X alias did not, much as they look the same

                     

                    6 The command line entry that worked was:

                     

                    ln -s /Library/FileMaker\ Server/Data/Databases/RC_Data_FMS/containers/Files/containers/pdfs/  /Library/Webserver/Documents/xxx

                     

                    (note the escaping of the space in 'filemaker Server')

                     

                    7 Now via remote fmnet access I can insert a pdf file 'showme.pdf' in the container field and immediately it can be directly browsed via

                     

                    http://myIPaddress/xxx/showme.pdf

                     

                    8 Now if I remove the file by emptying the container field, or deleting its record, it is removed and cannot be accessed with a browser.

                     

                    9 This all means one can use Open Storage with FMS to remotely manage a variety of web site content via custom FMP application - useful for a user who does not want to mess about with an FTP client or Contribute: you can provide a smooth FM interface for, say, managing photos associated with a PHP published application.

                     

                    10 My application is for a business client - overnight an FMP client (b/c FMS cannot export to pdf) running on the server produces about 100 management reports from a data store as pdfs. Some are new, some replace earlier versions. By inserting each one in a container field in a table that manages the reports I can remove obsolete pdfs, and also manage replacement of the original pdfs if the report design is tweaked.

                     

                    11 A simple IWP or CWP site can now make the reports available to management world wide.