not sure if I get it right - but You can add content to any field on Your client, doesn't matter if the files are local or hosted on FMS
You can run FileMaker Pro client on the same server at the same time and script the file insertion. This is not recommended by FileMaker, so could be a short-term solution. Another drawback - you will need an extra licence for FileMaker Pro client
I'm not sure my first description is clear enougth and so I try to tell something more:
I have written a plugin, triggered by actions on a client, that is able to create itself new files on another machine (in my case the same machine that hosts FM Server). When it happens, I should automatically insert this new file inside a container field, I mean that this operation hasn't to be done by handle from an operator (ie client) but by using a script. It means also that this operation has to be done on the Server (so I need to use the function "Perform script on Server") but the function "Insert file", that I would use if I was on the Client, cannot be used on the Server because it's not supported. Maybe am I wrong? If it's so tell me so that I can understand.
Let me know if some other details could be useful, Markus, and, in any case, thanks a lot for yuor support.
Thanks Nicolai but this can't be my solution since my Clients have to work via web browser: all the machines that hosts Clients are PC with Ubuntu and FM doesn't work with Linux...
I think I would need a custom function or a plugin (but in this case I'm not sure that I can interact with the database...) through which insert my file inside the container field.
In any case thanks a lot for your suggestion.
"insert from URL ( file: )" is supported on server.
OTOH, if you can write plug in, why don't you write inserting file function?
ScriptMaster can do it. (but I didn't test on sever since not having server licence)
MBS Plugin has also tons of functions to read files.
e.g. Files.ReadFile for a generic one.
Also specialized functions like Files.ReadJPEG and Files.ReadPDF which can calculate previews.
I meant the instance of FIleMaker Pro on the same workstation as the one hosting FileMaker Server. This has to be mac or PC. You can run Server and Pro on the same computer, although it is not recommended. Than you can run a script on the FileMaker Pro to insert the database hosted on FileMaker Server (on the same computer).
Yes, Nicolai, in this way I know that it works but my need is different: the clients have to drive the triggering of file creation and next storage of the file inside the container field!
I can't foresee that this kind of operation can be done only on one machine namely the server: the application is client/server and every time any client starts a particular operation it's triggering the activity on server side. I don't know if my need is clear now.
So the question changes to how to do it in FIleMaker pro on the server without user interaction based on particular event.
On PC you can run a powershell script on the background to monitor a folder and in the event of folder change assign an action, such as run VBS file to open FileMaker Pro and insert the file.
On a mac you can use User Agent and run AppleScript to do the same. ( I have a feeling your server is on PC)
I think that the 'insert from URL' might be your answer, as user19752 mentioned. You would want to use the 'File' protocol version of it, to reference a local file from the OS. The Filemaker Server has access to the Temp directory (see 'get(temporarypath)' function here) and the Documents directory (see 'get(documentspath)' function, e.g. '/HD/Users/JoeJoe/Documents/').
So, I think you would want to have your plugin save whatever file it is creating to one of those paths, then use the 'insert from URL' step to reference those paths and the filename. You would need to know the name of the file being created, of course, but I imagine that you do. The URL would look something like: file:///MacintoshHD/Users/justin/Documents/.
Here's a Wikipedia article on the FILE protocol.
OR, as others have suggested, use a plugin to insert the file from the server. I Monkey Bread (as noted below), or I think Base Elements does it, too.
You can't do it using pure FileMaker Server. It's not supported.
However, you can use a free plugin called ScriptMaster, which has a function to insert a file into a container field and it runs on server.
I have created my own plugin using ScriptMaster. If you need it I'll be happy to share it with you.
See this screenshot.
I remember at devcon someone showing how to do this, I think it's the temporary file path that server can actually access.
The example was you upload an excel spreadsheet into a container field and then run "perform script on server" to export the document out of the container and use import, to import the records. So that the import runs 100 times faster because it runs on server and not on client.
If you went to devcon I'm pretty sure what you want is in this speaker session.
It looks like you are missing a drive letter, e.g. "C:" and there is unessessary "///" after "file:"