David Jondreau Posted May 14, 2014 Posted May 14, 2014 I'm trying to set up a server-side script that sends an e-mail with an attachment stored on the same machine using SuperContainer. I know the folder path from starting at the SuperContainer folder, but how do I get from a FileMaker-recognized "start" ( DesktopPath or DocumentsPath or something more general) to the SuperContainer folder? What's the best way to reference a SuperContainer filepath from the server itself?
Joe Pampalon Posted May 14, 2014 Posted May 14, 2014 Hi David, We recommend using the absolute path for any file path. On OS X, this means starting the path with either “/Volumes” or “/“, and on Windows, this means starting the path with the drive letter. For example, these two paths point to the same file: “/Volumes/Macintosh HD/Users/<username>/Desktop/test.txt” and “/Users/<username>/Desktop/test.txt" Please note the FileMaker Get functions (e.g., Get(DesktopPath)) return a path that begins with the name of the system volume. For example, Get(DesktopPath) returns “/Macintosh HD/Users/<username>/Desktop/“ where “Macintosh HD” is the system volume.
David Jondreau Posted May 30, 2014 Author Posted May 30, 2014 OK, so I've been plugging away at this, and "/Volumes" isn't cutting it. SC is creating a folder within itself and not using the absolute path. I'd like to copy a file stored with SC to a folder where Server can e-mail it as an attachment. Using SCCopy(), I can copy the file, but it always puts it in a subfolder of the SuperContainer/Files/ folder. Feeding SCCopy a destination path of: "/Volumes" & Get ( DocumentsPath ) which is equal to /Volumes/OSX/Library/FileMaker Server/Data/Documents/ I get a file copied to: OSX/Users/Shared/SuperContainer/Files/Volumes/OSX/Library/FileMaker Server/Data/Documents/filename.pdf Instead of: /Volumes/OSX/Library/FileMaker Server/Data/Documents/filename.pdf It's the same if I used a temporary folder. It just created the whole temporary folder path inside SC's Files folder. How do I bump up a file out of SC to go down to the Doc (or Temp) folder?
Joe Pampalon Posted May 30, 2014 Posted May 30, 2014 Hi David, The SCCopy function is specifically meant for copying files from one SuperContainer directory to another SuperContainer directory. It will not copy files outside of the SuperContainer folder. I realize the documentation for the function does not mention this, and I will have it changed shortly. The function you want is SCDownload. You can supply a destination folder for the downloaded file.
Recommended Posts
This topic is 3898 days old. Please don't post here. Open a new topic instead.
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