Jump to content

Display stored GIF in web viewer


iwasnevy

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

Recommended Posts

Help!

I'm trying to display an animated gif on my layout using a web viewer. I can easily set up an absolute path to the file to accomplish this, but that's not a solid solution - if the computer gets renamed, replaced, if the database file gets moved, even if the .gif is moved with it, - anything could happen - the absolute path breaks. I can set up a calculated relative path to the database file, but if the databse does not reside on the startup drive, it's broken as well. (It's the way the path is calculated on a Mac - I can elaborate on why if anyone wants/needs.) Even then, if the database and the .gif are seperated, it's broken as well.

A much better solution would be to embedd the .gif into the database by storing it in a global container field (which I've done) and then (in the webviewer) reference the .gif stored in the container field, but I haven't been able to come up with a way.

Any help?

Thanks

Link to comment
Share on other sites

It's not possible to open an embedded file - you must export it first.

A simple solution would be to have a startup script export the global field's contents to a known location (e.g. the temporary folder), and point the web viewer to there.

Another option is to encode the image as base64 and embed it in the web viewer itself as part of the URL - see:

http://en.wikipedia.org/wiki/Data:_URI_scheme

This has the advantage of "marrying" the image permanently to the solution's schema, so that it persists even if the file is cloned.

Link to comment
Share on other sites

Another option is to encode the image as base64 and embed it in the web viewer itself as part of the URL - see:

http://en.wikipedia.org/wiki/Data:_URI_scheme

This has the advantage of "marrying" the image permanently to the solution's schema, so that it persists even if the file is cloned.

HAH! Elegant solution! Worked like a charm!

I NEVER would have come up with that on my own! Thank you thank you thank you!

If it helps anyone else searching on this, I couldn't quite figure out how to embed the Base64 data into the URL itself, so I wrote the Base64 data into HTML code, entered that code in a global field and called the html from that field up in the webviewer via the URL: "data:text/html," & fieldname.

AWESOME!

Here's the final result (file attached) - a cool progress indicator to give the user something to look at while FM goes in and cleans up errant empty records via a sript.

Animated_Progress_Indicator.zip

Edited by Guest
Link to comment
Share on other sites

  • 2 weeks later...

Yes I am using 9.0v3

I have tried the two posted files on OSX, XP and Vista

They only work on the OSX Machine.

I also put them on our FIlemaker server (Most up to date FMS9 on a PC Server) Open the file on a PC, big red X's, on Mac's beautiful stored gif's.

Link to comment
Share on other sites

Hi comment

I'm working on this problem...

On Windows that do not work but I think that it is only a minor bug with the code.

I'll send the final solution, hoping that will work even on Macs. ( also I want to modify the code so that it do not display the WV borders. )

Link to comment
Share on other sites

FYI

On the windows platform the boarder around the Web Viewer can not be removed. (Must be a feature.)

When ever I add a web viewer object to a layout it is always a royal pain to keep this in mind. Also the display is ALMOST exactly the same for both. Often you will need to resize the web viewer to a compromise size and placement for both platforms.

Also keep in mind, the web viewer renders last. So you can't place any objects over it. Just in case you were trying to use it as a background on a layout.

Jerry

Link to comment
Share on other sites

  • 3 months later...

IE can't manage base64 ...

That was true till the release of the last version ( 8 ) of Internet Explorer.

Now all those problems are gone and we can see base64 code directly embedded into the Web Viewer, even in the format that can hide the Web Viewer borders.

So, good news for windows users. :

WVbase64.zip

Link to comment
Share on other sites

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