Brian Dunning's FileMaker Custom Functions

RenameContainterFile ( ~FQFN ; ~NewFileName )

This Function will rename the file contained in a container.

  Average rating: 4.6 (24 votes) Log in to vote

Mark Geerdes   Mark Geerdes - Show more from this author
Technology By Design
https://www.tbdmn.com

Share on Facebook Share on Twitter

  Sample input:
Table::Field ; "NewFile.pdf"
  Sample output:
NewFile.pdf

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

This function will take the fully qualified field name of the container field, and the new file name and will rename the file that is contained in the container. Because it uses the Base64 functions, it is a little slow, so it might be best practice to Perform Script On Server. If the containers are compressed, you need to add a .gz to the end of the new file name in order to make it work correctly.

Parameters: Fully Qualified Field Name of Container, New Name of File

Created 12/29/2014 - Mark Geerdes

 

Comments

David   David
Dec 9, 2015
Wonderful find. It even works with externally stored containers. It changes the internally stored name as well as the name of the document itself. 5 Stars
 
Bob   Bob
Nov 17, 2017
Do you have Script
 
Mark Geerdes   Mark Geerdes, Technology By Design
Nov 18, 2017
Not sure what you mean. You will need FileMaker Advanced to import the custom function into your file. Then in your script, do a set field command to the container field. In the calculation box, use the name of the Custom Function, and give it the parameters as shown above.
 
Eric   Eric, SJSU
Jul 31, 2019
"RenameContainterFile". Did you mean
"RenameContainerFile"?
 
Gary   Gary, GC Consulting
Aug 15, 2020
Genius!
Exactly what I needed. I had > 100’000 weird image file extensions and when I changed them, voilà — the FileMaker showed all the images!
 
jeremy sterritt   jeremy sterritt
Jul 12, 2022
Works like a charm! I'm curious about David's comment above: "It changes the internally stored name as well as the name of the document itself." I would love to change document names this way, but I don't understand how it would work...
 

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: