Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Importing Pictures into container field for large database


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

Recommended Posts

  • Newbies
Posted

I'm new to Filemaker 10 Pro, but have used previous versions several years ago.

I have a large inventory database for vendors for our company. I just imported one vendor's product list, and there are about 5,000 items in the inventory. They also sent about 3,700 photos for our website. Not every product has an associated photo. The ones that do have photos with filenames that equal the product number (for example, product A110B has a photo named "A110B.JPG"), but product B220Z does not have a photo, so there is no file named "B220Z.JPG".

I imported the photos but forgot that I need to associate the product number and the photo name. I just did an "file > import records > folder" for this. I didn't realize that would not work until I looked at a product that I own and saw the photo was wrong. Apparently my import just associated the first JPG with the first record, the second JPG with the second record, etc.

Is there a way I can set up the import process to get the product name from the product name field, create the "product_name.jpg" filename, and then get the correct file from the folder? The photos are going into a container field; that part worked great. I'm thinking a script would probably work, but I'm new to scripting and don't know where to start. The script reference with the product is great if you know what you're doing to begin with.

I have to add several more vendors with several hundred (or more) photos each.

In addition, each vendor updates his product list weekly, and if there are new or added photos, they send those as well. My import has to be able to add new photos and update any that have changed.

Thanks for any pointers!! So far, I really like the new version. What a huge difference in usability over the V4 and V5 versions I remember.

John

Posted (edited)

My suggestion is to NOT store the photos in container fields, but rather as references to the image files. Since the files are named for the product, you can calculate the path to the file, thereby linking the image file to the product record.

Search the forum for many threads concerning images and references. Here's a good one, Link

..and Welcome to the Forum.

Edited by Guest
  • Newbies
Posted

Thank you for the advice. I had already planned on importing by reference. The first import went from a file size of 670KB to 19.5MB and it stayed there even after cutting all of the thumbnails. Those pictures were imported by reference too, not pasted into the database. There is about 80MB of photos now and much more than that to come. It seems like a lot of storage was being used to do nothing except store text for the file path specifications if it really did import by reference.

I don't want to keep doing the import until I'm sure the logic is right.

My problem is, our last version that I worked with was 5.5. The scripting language has changed a lot and FMP now does on its own a lot of what we had to program with 5.5 - so I'm not confident in my ability to do scripts. Also, my primary function then was doing layouts, connecting them, etc. rather than the hard programming.

I'm having trouble with the script commands to first insert the pictures, then to update them if they are found in the newest import files. And as I mentioned, my main problem is getting the right picture into the right record, based on item number. My import just pulled all the photos in, started storing them at record 1 and kept going until it ran out of pictures to import. NOT what I needed!

Thanks!

Posted (edited)

Well, what I suggest is that you don't import.

You know the path. Simply create a calculation field that equals the path to the image, result container. Please re-read the link suggested, especially Fenton's comments.

Edited by Guest
Posted

Another cool option is to upload all your pictures to a website and have FM display a web viewer on your layout with a calculation that points to the picture on the web.

This method does not require ANY new fields in your database. ;)

  • 1 month later...
Posted

I'm doing something very similar.

I use a separate table for Products and Images. The images are not always named consistently, but usually start with the product code.

I have a calculation field in the Images table which takes the first 'word' of the image and derives a product code from it. That field becomes the match for the relationship between product and image. This is also useful as there can be many images for one product.

I've also added a script that placed the image straight into Quark when clicked, but that's another story (but a great time-saver).

This topic is 5603 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.