Skip 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.

Problem with % in Image path

Featured Replies

I just ran into an odd problem. I have a file that gets book images from Amazon. It didn't work on a couple. The reason was that there was a % character ("%2B" was the combo) in the file name (which was in the xml returned from a web services request to Amazon).

What I found was that FileMaker translates (unescapes) the % and characters following in a file path, in the image path; so the path to the file is not valid. The latter surprised me, as % is valid in a file system file path (silly perhaps, but valid). There is no way you can use that file path to Insert or show an image file.

The work-around, which was simple enough, was to remove the % character when writing the file (using curl to download, file path stored in a FileMaker field, where I could easily remove the %). I could not think of any way to make FileMaker accept the % sign in the path.

Edited by Guest
Web Viewer works fine

I am not sure what situation you describe. I have an image file named "FM&P.png", and I see that a calculated container shows this image, whether the supplied path is:

image:FM%P.png

or

image:FM%25P.png

Going the other way around, the calculated path is "image:FM%25P.png". It might be different if the reference is a URL (where the % character is reserved).

  • Author

The problem seems to be limited to HTML entities. So "%2B" is translated to "+" and the path fails, so does "%20" (space).

Strangely enough, you can use Insert manually with one of these file names. But you will not see the same name in the GetAsText ( image ).

51s85%20bmbDL.jpg

becomes:

51s85%2520bmbDL.jpg

Duh, I just figured it out. "%25" is the URL encoded entity for "%". So FileMaker is escaping "%", but only when it is the 1st character of an HTML character entity. So, you can do the same, in your calculation for the file path,

Substitute ( file name; "%"; "%25" )

Or, like I did earlier, just write the file without it.

Edited by Guest

Yeah, I can see it now - it is kinda weird. If I ask it to show "image:FM%20P.png", it says it cannot find the file "FM P.png".

However, GetAsURLEncoded ( Path ) seems to fix it. I wonder if one should always use that, or are there cases where it will break an otherwise valid path...

  • Author

Yeah, apparently a FileMaker syntax path is not just what it seems. There's some escaping behind the scenes. GetAsURLEncoded ( file name ) works, and is probably the best method. But if I do more of the path than that, it doesn't work. I think escaping the % will also always work, because I think all HTML entities begin with %. But I'm no expert on this.

I imagine Amazon let the characters be escaped by the xml engine. I'm sure they know better than I. You will not see the same thing with the actual images on their web pages.

Actually, HTML/XML entities begin with an ampersand - percent-encoding is for URLs.

But if I do more of the path than that, it doesn't work.

What do you mean by that? Like, what happens if you URL-encode the entire path?

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.