Jump to content
Server Maintenance This Week. ×

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


This topic is 3819 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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 )
)
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

 

 

 

Link to comment
Share on other sites

This topic is 3819 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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