naio 1 Posted May 30, 2020 Share Posted May 30, 2020 I store documents (pdf, jpg,...) in a container field, externally and open, I see all of the container files under a RC_Data_FMS folder. I would like to be able to email one of these documents enclosed in the message using the Send mail script step, so I need to use the external file path of the container object. I've tried this locally and it works but I can't get it working in the hosted file. The path I use in the hosted file is: file:RC_Data_FMS/.../containerFieldName/file.pdf The hosted file that has to run the script is in the same level as the RC_Data_FMS folder, so all seems correct Link to post Share on other sites
Wim Decorte 514 Posted May 30, 2020 Share Posted May 30, 2020 You're not supposed to touch or be able to read from that path directly; the RC data files are live FM files just like the actual FM file. Only FMS itself should have access to it. The way to email a file is to first export it out fo the container, to say the user's doc folder or temp folder and use that path for the Send Mail script step. 1 Link to post Share on other sites
ggt667 10 Posted May 31, 2020 Share Posted May 31, 2020 In which probably is good if each user intends to store that file, however if the user have no ambition to pull the file from the database before sending reduces available bandwidth. Is there a way to send from server? Link to post Share on other sites
Wim Decorte 514 Posted May 31, 2020 Share Posted May 31, 2020 Let me put it bluntly: if the user does not want to interact with the container data through FileMaker then don't use FileMaker. The Remote Container feature is a strictly internal FMS feature to make its management of that data easier and achieve backup and storage efficiencies. It is NOT meant to expose that data to anything outside of FM. And if you use those files directly without going through FM then you are risking corruption to the solution. If bandwidth is a big issue then don't store that data in FM to begin with, but use a service that does file management and that has an API (dropbox, box.com, OneDrive, Google Drive, OwnCloud, NextCloud,... the list long). FM is excellent at integrating with APIs. 1 Link to post Share on other sites
naio 1 Posted May 31, 2020 Author Share Posted May 31, 2020 Actually I've found this which explains it all: https://help.claris.com/en/pro-help/#page/FMP_Help%2Fpaths-in-server-side-scripts.html%23 So the only way to send the files hosted by FMS is exporting them into a user folder. Link to post Share on other sites
Wim Decorte 514 Posted May 31, 2020 Share Posted May 31, 2020 “the only way” When using FM’s native Send Mail script step: yes. when using some email provider API or file sharing API: no, then you have more options. Link to post Share on other sites
ggt667 10 Posted May 31, 2020 Share Posted May 31, 2020 (edited) 8 hours ago, Wim Decorte said: If the user does not want to interact with the container data through FileMaker then don't use FileMaker. I did expect a PSOS answer here. Edited May 31, 2020 by ggt667 Link to post Share on other sites
Wim Decorte 514 Posted May 31, 2020 Share Posted May 31, 2020 (edited) Why? PSoS doesn't make no difference in the basic principle of not touching the RC files. PSoS uses the FMS scripting engine process, whereas it is the db engine process that maintains control over all the data files (FM files + RC files). So as far as the db engine process is concerned, the FMS scripting engine is just as foreign as anything from the outside. The pure and basic principle is: interact with container data ONLY through a FM container field, do not try to read directly from the hard drive. Edited May 31, 2020 by Wim Decorte Link to post Share on other sites
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now