Thanks! Sorry I don't get it. I am using a legit path as explained aiming at the documents path and it is written properly which I veryfied. I need to reimport it via InsertFromURL script step where it fails.
When it fails, is there an error code that you are capturing via Get( LastError ) which you can share here? That could help everyone reading this thread be better able to assist.
I'll note that one common gotcha with Insert From URL used to be that, if you are inserting into a field (as opposed to a variable), then that field needs to be present on the layout where the insert is happening. It's possible that this could have changed, but I don't recall that being the case. Perhaps someone else can chime in to confirm/refute that. It's definitely something that has tripped up a lot of developers in the past.
While the path may vary from the above, my point is that the server's Document folder is not a user Document folder. Server is unable to access a user's Document folder or the Desktop folder contained in it.
Thank you very much @steve_ssh all very helpful to check!
I got it to work by using ConvertFromFileMakerPath ( $FilePath ; URLPath ) which added the prefix as desired: file:/// and was able to insert into the field on the layout. I tried the same path to insert into a variable $target without success and error 507 // "Value in field failed calculation test of validation entry option".
This is all currently running not server-sided and hopefully if resolved it can be performed on server. Thanks again!
PS //edit:
it is all on latest and greates FM20.2.1 and MacOS 13.6.1 to be later moved to Windows 2019 Server and FMS20.2.1
That error is weird because it is inserted into a variable where no field validation happens. That variable $target is also not used in any field validation calculation. Pretty mind buckling.
Thanks to Alex Zueiv he told me how to get it to work here: Claris Community (English)
// The solution is to add the cURL option header: "--FM-return-container-variable"
Confessing: I spent hours on this mislead by Error 507 and it seamed to my limited mind counter intuitive that just switching from container field to target variable would fail me as it did. Glad Alex knew!
Sometimes I think Alex is a FileMaker savant. So many smart and super-helpful people here, and in the FM Community at large.
Although I've been developing FM solutions since v4 or v5 (once Microsoft [edit: bought and] killed support for FoxBase+/Mac) I still learn something every day from the FM Community. Maybe something I don't need right now, but it sure keeps my bookmarks well populated.