Hi this is Matt at AppWorks and today’s video is going to be how container fields work in FileMaker, and specifically how they work with external storage. I have a sample database of 400 or so images that I’ve downloaded and you can see some info about the image – some are a couple thousand pixels wide and some at the end are a bit bigger than that. It tells me the size of the image, so for the larger ones I get a spinning beach ball because it takes a while to load.

For now, all of these are stored in FileMaker, so here’s what it would look like if I look at the database. The image field is in the database and just says container and doesn’t have any information on the options. I also have a FileMaker server loaded for this file, so I can see the total size of my database is 485MB, and I have the external container folder that we’re going to be playing with in a minute – right now its empty.

How do I convert these to be external storage, and what are the options you get? For one, if you go back to the graph – Manage – Database, on the image field, you can just change its storage to external, and then you get two options – Secure storage and Open storage.

Secure storage scares me because it puts everything in an encrypted folder. It’s a very good way to do it if you really need encrypted data, but then there’s a magical invisible link between what FileMaker stores and what the database stores – that’ll be part 2 of the video. For part 1, we’re going to use open storage. The default structure puts everything into a folder where all the fields, all the images just go loose into one folder. Let’s take a look at what that looks like so we can see what happens. I’ll click transfer.

This box comes up and what’s going to happen is FileMaker is going to transfer all of the images out of my database and onto the external folder on the server. We’ll actually be able to watch the server as it moves these images out, so if I bring the server up while that’s happening, the database size won’t change yet until I close the file, but the image test folder now has the actual images flowing into this folder. As I scroll, I can see hundreds of images appearing. In not very long, that’s going to finish.

I don’t particularly like this structure, though, because if you’ve got two images with the same name, then FileMaker will actually handle it – it will rename the two because you can’t have two files with the same name in the folder, but it will do it in a way that you don’t get to manage, and can’t tell which image belongs to which record in your database.

Here’s how I recommend doing it. When it finishes, we’ll get a summary telling if those transfers worked and if there were any errors. It also makes a log file of the whole thing. I’m going to click Ok. Now if I go to my server, I’ll notice my database file is still really large, but I want to do one other thing. I’m going to click on my FileMaker server admin console. I’ll close the database and I’m going to close it on the server, which will take a little bit, because FileMaker server, when it closed the file, it saved it, and now none of the images are in the database. It’s incredibly smaller. I’m going to open it again for hosting. Now all of the images have been moved out of the database and into this folder.

I’m going to log back into that file on my server. Here we go – looks exactly the same as it did. Flipping through the images is now going to actually be a little bit faster, because FileMaker, I think, performed a little bit better with external containers than it does with internal.

Part 2 – let’s talk about what it takes to move these to a folder structure that I think makes more sense. Here’s how we do that – on the image field, when it says external, I’m going to have it go into a folder called images/ and rather than having it go into a loose folder altogether, I’m going to concatenate the ID, in this case it’s just a UUID field for the table, then add one more / at the end, so the structure on the server will look like this.

Then we’ll do the same process. By the way, this process of moving the containers is actually kind of magically interruptible and resumable. If you’ve got a really large set, it’s possible to stop this. Here’s what’s happening on the server – if I look at the server, it’s going to be structuring the images. Now in my image test folder, I get a folder called images. I get one folder with each UUID, and inside that is one file. I find that much easier to manage. It’s just a lot more safe to me, because I can easily go find that record. I can look at my database and find the ID and go find the image with that ID, manage it and back it up separately.

Here’s my summary telling me my transfer’s good. Thanks for watching part 1, part 2 will look at secure storage.