Jump to content
Sign in to follow this  
Jhon Doe

Display base64 images

Recommended Posts

Hi everyone

i'm new in filemaker, i'm using filemaker 17 and currently i'm involve in a proyect but i have a problem that i can't resolve, maybe someone of you have had the same problem.  

I'm saving images in base64 format in a database to show them in a layout with web viewer,that doesn't has any problem, the problem is that i'm using a portal and i didn't know that portals don't support web viewer. I have to display those images but i can't remove the portal since i didn't do that layout and it has scripts using it along with the portal, is there a way to show images saved in base64 without use web viewer? (I've already tried to use container field but it only show a "?" image 😓 )

 

My English is not the best but I tried my best ,Thanks for your help
 

Share this post


Link to post
Share on other sites
1 hour ago, Jhon Doe said:

I've already tried to use container field

What exactly have you tried? A calculated container using the Base64Decode() function should work.

Share this post


Link to post
Share on other sites

Hi, I tried that code Base64Decode($(ImageInBase64),"name.png"), but since the $(ImageInBase64) is an image in base64 the container only shows me a "?" image.

Share this post


Link to post
Share on other sites

I am afraid I don't understand your explanation. You should have a text field containing base64 encoded image data. Then a calculation field (result is Container) =

Base64Decode ( YourTextField ; "name.png" )

should display the reconstructed image (assuming it was a .png image originally).

Share this post


Link to post
Share on other sites

sorry for my explanation, yes you right i've done that, but I want to show the image itself, and with this code, the container shows me a png icon and not the content of the text field containing base64 encoded image data. I don't know whether  I 'm doing something wrong when I pass the data to that command or my data in base64 is bad encoded or damaged.

Base64Decode ( YourTextField ; "name.png" )

Thank you for your help, I've figured out a way to resolve this problem, I've save the images that i need to show directly in the container field without use the text encoded in base64.

Share this post


Link to post
Share on other sites
7 minutes ago, Jhon Doe said:

I don't know whether  I 'm doing something wrong when I pass the data to that command or my data in base64 is bad encoded or damaged.

I don't know that either. But it does work for me, so you can paste your data into the attached file and see what you get.

 

Base64Decode.fmp12

Share this post


Link to post
Share on other sites

Thank you once again, I've seen what was my mistake, you have to remove the line : data:image/png;base64 !!!!

 

 

Edited by Jhon Doe

Share this post


Link to post
Share on other sites

 

4 minutes ago, comment said:

I am not aware of any such restriction, and I doubt it exists. A text field can contain up to 10 million characters - and the specs say nothing about any limits when processing it (except, of course, available memory).

yes, I was on mistake that was the first thing I thought because i didn't realize what  the error was. 

Edited by Jhon Doe

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Similar Content

    • By Answers
      Our people out in the field take photos which go directly into the container fields, we would like those photos to automatically transfer to the camera roll/gallery. I know there is an export command and that would allow the techs to export and choose the location, save image etc... But that is a tad too complicated for them.
      Any suggestions on how to automate this process, the script for export field contents doesn't have a choice to save to camera roll.
      Thank you!
      Caroline
    • By St3v1e
      Hi,
      As a complete novice to FMP, I'm attempting my very first database. We rely on storing our contracts on Google & Dropbox. I've been trying to either embed the pdf's into a "tab", or (my preferred option) to have an "Add URL" button to link to the online pdf.
      I tried adding a field and copying and pasting the URL, but it's not clickable, and I'd need to add another field for each pdf/contract.
      Is there a better more efficient way to do this?
      Thanks
      Steve
    • By innodat
      Does anyone know how to fix an image from appearing too small within a container in WebDirect? In FMP it fills the container. Tried to "play" with most settings relating to containers, including margins, frame, etc. - no success. The problem presents itself in Safari in macOS Catalina, as well as Edge on Windows 10

      See image attached.
      I sure hope this isn't a bug! Because if it's a bug then it will get fixed... well, never. 
       

    • By naio
      I have FMS17 running a system shell script that does the following:
      Tar the latest backup folder and leave it into a specific 'tar' folder Mount an external volume share rsync external share and tar folder The script was running twice a day without any problem until last week when I upgraded the server OS from High Sierra to Catalina.
      FMS event log just shows the following:
      Schedule "schedule-name" aborted; aborted by user. Possibly it's a problem with permissions but how to fix it?
    • By gczychi
      Browsing through my event logs, I am finding weird scripting errors, like:
      ... Information 645 ...local Schedule "Import Main (every minute 8-20)" scripting error (401) at "Import : Import Main : 36 : Perform Find". How can a simple «Perform Find» script step (which works just fine in the server scheduled script, btw.) generate a scripting error? Occasions where the FoundSet = 0 should be considered «normal».
      I also have found other errors, that shouldn't be errors, like «Go to Record/Request/Page [ Next ; Exit after last ]», when there is no next Record.
      What is the best way to prevent this? It’s clogging the log files.
      Thanks a lot for any insight!
      Gary
       
  • Who Viewed the Topic

    1 member has viewed this topic:
    Christoph 
×
×
  • Create New...

Important Information

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