11 Replies Latest reply on Oct 22, 2012 4:13 PM by NewFM_Dev

    IWP-Container Content Email via Script

    NewFM_Dev

      Hello,

      I am using FMP12 advanced.

      I've used IWP to publish some files in a container.

      I've written a script to allow people to d/l the content of the container using a 'send mail' script and 'Attach File' option.

       

      When I run the script locally it works fine. When I publish the self-contained 'stored internally' information, the script sends the

      email w/o the attachment. I'm using internal storage.

       

      In the 'Add File' window, I succeed locally using a set variable $SendFile, but again this does not work in IWP.

       

      1-Does anyone know a simple d/l script or commend to d/l information from the IWP browser?

      2-Any suggestions for attaching a 'Contained File' from within an IWP script?

       

      Thanks All !!

       

      Message was edited by: NewFM_Dev

        • 1. Re: IWP-Container Content Email via Script
          BowdenData

          Hi,

           

          Can you post your script? Sounds like you are close if it works in native FMP.

           

          Regards,

          Doug

          • 2. Re: IWP-Container Content Email via Script
            NewFM_Dev

            Hi Doug, here is the Add File dialog screen.

            The script itself is 'no dialog' send email. I used SMTP, since it would be sent via an external server.

            I post the add file part, 'cos I believe the issue is locating the the file correctly.

            So created  a field to hold only the filename [Get as Text of the container] yields the filename.

            Then i set $SendFile=FileName [from GetasText] at the end of the path.

             

            It works locally, but no int IWP. Again, with this, i store externally 'open' and it works.

            The uploader is suppoed to upload needed external files, but I noticethe upload size of the db is smaller when I store externally.

             

            Storing INTERNALLY works locally, but not in IWP. Sorry if I'm repeating, but I'm tryingto be clear.

             

            Q: IS there an easy way to add a button to the IWP browser window for the client to simply click 'download'?

             

            Thanks!

            • 3. Re: IWP-Container Content Email via Script
              beverly

              Are you using SMTP to send the email?

              Yes, please post the script.

               

              Beverly

              • 4. Re: IWP-Container Content Email via Script
                beverly

                Have you personally tried to right+click an image displayed this way? often a browser image can be download via the contextual menu. I haven't tested with container fields in IWP. Some site will place images in the background and they cannot be downloaded.

                 

                YMMV (your mileage may vary)

                Beverly

                • 5. Re: IWP-Container Content Email via Script
                  NewFM_Dev

                  Hi Beverly, Yes, I have right clicked and  got some 'save as' type things, but not 'download'. YES, I used the SMTP and again with success the first time locally.

                   

                  I posted the dialog above.

                   

                  Thanks

                  • 6. Re: IWP-Container Content Email via Script
                    NewFM_Dev

                    Thanks in advance. To save anyone from going down the same path as me [no pun], perhaps I should first ask of the best way to publish information for download from a browser, speciically with the ability to click a download button and D/L a file from within it's container. ??

                    • 7. Re: IWP-Container Content Email via Script
                      BowdenData

                      Hi,

                       

                      When the container fields are stored internally, I don't know of any way to do this with IWP. With internal storage, you would need to export the container contents to something like the OS 'temp' folder (and set the path to this exported file in a variable). You would then send email and for the attachment, specify just the variable.

                       

                      Export field contents is not IWP compatible, so you are stuck there.

                       

                      With storing your containers externally (managed/external/open format), I am not sure. You are on the right track for testing. I am not able to test this myself at this time. I am thinking that for IWP, you might need to set the path to the external file in "OS" format, not FMP format.

                       

                      So, your variable would be something like this on a Mac:

                       

                      /directoryName/fileName   or maybe

                      file:///directoryName/fileName or maybe

                      file://localhost/directoryName/fileName

                       

                       

                      and if on Windows:

                      C:\directoryName\fileName  (using the proper drive letter of course)

                       

                      So, no direct solution, but perhaps some clues.

                       

                      Please note that if this is critical and you can't solve the issue in FMP, SuperContainer from 360Works allows a lot more flexibility with working with container type data via IWP.

                       

                      HTH.

                      Doug

                      • 8. Re: IWP-Container Content Email via Script
                        NewFM_Dev

                        HI Doug, That's exactly what I was just checking into [export field].

                        But yet when I take a step back, I can only imagine that with all thegreat functions, there MUST be a way to allow

                        someone to just download data [of any kind] from a web-browser window....maybe not.

                         

                        I've got alot built around FMP, so I gotta give it a good shot, but always open to things that create solutions.

                         

                         

                        I even thought that maybe, I could script  to create a link to a folder, but even that would require an export of the field.

                         

                        Maybe it's FM's way of requiring people to get the new 'FREE' FM Go iphone/pad, that would just connect to the db.

                        Hmmm.

                        Thanks!

                        • 9. Re: IWP-Container Content Email via Script
                          NewFM_Dev

                          Hi Doug, I'm pretty weak in the server domain paths, but what do you think about going into 'Manage Containers' and set a file path back to the IP address/DB Directory/DBName/$VariableName  ??

                          -Thanks!

                          • 10. Re: IWP-Container Content Email via Script
                            NewFM_Dev

                            Hello,

                            Well it seems that there was a non-obvious solution to this.

                            From a web -browser, an image is a 'Save Image As'...as Beverly suggested.

                            And for documents, [my primary interest], a container with a non-image shows up as an auto d/l link.

                            From within FM Go, it is no problem. So thanks for looking things over.

                            ...though it still remains a bit of a mystery as to why I can just attach the file that I name from w/in the

                            internally stored container content.

                             

                            Best regards!

                            • 11. Re: IWP-Container Content Email via Script
                              NewFM_Dev

                              Hi Bowden. I got away from the forum for awhile 'cos I wanted to try some things. The GetPath type commands allow a chance to retrieve the path the a file will be stored in. But as you say theexport field is not avlbl, EVEN in Server !! A simple Get (ContainerPath) would be THE answer, after which we could specify which container specifically by field. From there, the $variable could be set to that path and viola. This just does not make sense that we cannot attach a container content.

                              Oddly enough, even though export field is supposedly non-compatible in Server, it actually does [from the FM Net] . but the same script triggered from IWP does not work.. I think it's a bug.

                               

                              In other words, triggering a server script to export a field and email it works fine when it's triggered thru FMNet.

                               

                              But when i create a button to trigger the same script thru IWP, the Expoert field commend does NOT work and the file is not emailed...weird.

                               

                              ..love to figure this one out. Right clicking DOES allow them to directly d/l, but some hosts don't show the container content.

                              -FMDev