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.

How to determine if a image ref is valid?

Featured Replies

Does any one know of a way to determine if an image reference stored in a Container field is valid? And.. I'd like to do this without a plugin if possible.

More specifically.. I have a table of images where the image container is a calculated field and its formula is something like:

myContainer = myPathName

and myPathName contains a text value like: "image:Images/ITM_000038.jpg"

So the pictures are not imported. I just put them into a folder called 'Images' in the same folder as the database and FM loads them automatically when needed.

The problem is, I would like to write a utiltiy script to step through the database records and flag those who have missing files out on the hard drive. I'm wondering if this can be done without a plugin.

Thanks. John

If you're 100% sure that the file extension is compatible with the webviewer (safari on mac, IE on Windows), then you can display this file in a webviewer and see if the "content" is empty or not.

If you do it with a not compatible file type, the file will be "downloaded".

I was wondering about this too. It would be great to be able to detect a 404 in a Web Viewer in a way other than by sight.

If you have control over when and how the files are created or written to the directory, you can script adding info to a field (I use a field called fileExists) at the same time and check for that.

Otherwise, a plug-in like Troi URL could fetch that info (or even the HTML source) for you.

I didn't mean "by sight" but using GetLayoutObjectAttribute ( "WebViewer" ; "content" )

  • Author

fabriceN.. thanks for the suggestion, very nice idea.

But.. It doesn't seem to work for images. The 'GetLayoutObjectAttribute' function returns "" for records with valid paths and those with invalid paths. The only other value I have gotten from this function is '' which occurs for just one of my images. Oddly.. this image is a valid jpeg that does display in the web viewer as well as my container field. So I'm not sure what's up there.

This is very frustrating. If Filemaker containers are going to store file references by default, wouldn't the first thing that every developer would want to do is figure out if the linked files are actually there or not? Seems very strange that one cannot do this without resorting to a plugin.

John

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.