Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Request clarification on setting *file* names in container Managed Storage

Featured Replies

Using FM12 Advanced, I'm setting a Container field to "Store container data externally" in "Open" format.

 

I have a relative directory defined & available, and a separate calculation in the "Open storage:" field beneath.

Everything's working as I expect -- i.e. I can use a "Let" calc. in the open storage field to define an arbitrary pathname for each new file added to a container field in each new record -- BUT

I can't figure out how to programmatically set the *file name* itself in this operation.

-----

What I am trying to do:

  1. In the Finder, drag a file (JPG image in this case,) with filename "JohnDoe.jpg", into a Filemaker container field w/ managed storage.
  2. Have Filemaker receive & store that file within its Managed Storage hierarchy that I've defined.
  3. But with a new, arbitrary file *name* as well, i.e. "2013_11_14_JohnDoe-Profile.jpg".

 

Why is my calculation (copied below) not setting the file name properly?  The file lands in the correct Filemaker-controlled Managed Storage directory, but the filename remains "JohnDoe.jpg".  How do I get Filemaker to store the file as (for example) "2013_11_14_JohnDoe-Profile.jpg"?

Let (    [   

$directory = "Multimedia/" & MainCategory & "/"  ;
$filename = Case ( MainCategory = "CATALOG_ITEM" ; CATALOG::C_ItemImageFileName & ".jpg" )
];

Case ( MainCategory = "CATALOG_ITEM" ; $directory & CATALOG::C_ItemImageFileName & ".jpg" ; $directory )
)

You can't do it in one step because calc is meant to just provide a folder name.

 

If you want to rename the file, let the user drag & drop into a global container, then use the "export field content" to export it to the temp folder with the filename you want and then have the script insert it into the destination container

  • Author

Thanks for your reply. I got this working (see linked demo file,) but am now frustrated by the problem of removing the temporary files that will build up with this method.

 

Probably I will go ahead and use a 3rd party plugin (MonkeyBread Software) to handle file operations until (if) Filemaker 13 or later starts supporting file ops natively.

 

 

 

When you close the FileMaker app, FM empties the temp folder  ( located at Get ( TemporaryPath ) ).

  • Author

Thanks for that tip, I'm using Get (TemporaryPath).  That'll enable possible future cross-platform or multi-user situations.

 

With appreciation,  -G

Create an account or sign in to comment

Similar Content

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.