AnsweredAssumed Answered

FMP 12 Container File Names - UGH

Question asked by davidjhayden on Apr 23, 2012
Latest reply on Apr 23, 2012 by tech_liaison

While I love the new external container storage feature for FM 12 -- at least in principal -- I'm having difficulty wrapping my head around filenames, particularly for exporting.


In the past I'd have files stored in a related table, with the idea that a primary record could have multiple attachments. In the Files table I'd have a calculated field called FileName [GetAsText (Container)] to pull the original filename and in a portal on the main screen there'd be a button tied to an export script. To make the user's life easier the script would simply dump a copy of the file on the user's desktop using the original filename and open it in the default application.


When using the new secure storage function it looks like (reasonably) FileMaker is renaming the file, and the old GetAsText trick is returning both the new name AND the file path, so instead of filename.xlsx, I now get a long path and the new name -- something like /folder1/folder2/1234. I can strip out the path, but how do I get the original name?


NOT using the secure storage feature introduces other problems, since it's not inconceivable that in a multi-user environment that someone will try to store a file with the same name as something previously stored.


A little astonished that -- unless I'm missing something (and I hope I am) that there doesn't seem to be a way to retain the original filename without forcing the user to enter by hand when they initially upload the file.


Anyone found a solution/workaround?


Dave Hayden