Jump to content

Problem using php to decode base64 generated by FileMaker 13 and also Base Elements plugin


Sky Willmott
 Share

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

Recommended Posts

Just wondering if anyone has a quick answer to this... I've been going round in circles trying to get it to work...

 

Firstly, I would like to use FileMaker Pro 13's base64encode function to encode a file in a container field, and then use httppost to send the encoded text to a php script on my web server which then does a base64_decode to then save the file (PDF, images etc) on the web server. However, php's base64_decode doesn't seem to work with the base64 encoded text that FileMaker has generated. The resulting file is saved, but cannot be opened/recognised.....

 

Further to this, I also need to be able to do the same in a FileMaker Pro 12 version, using the Base Elements Plugin functions to also do a base64 encode and an http POST....

 

Any ideas anyone..?

 

Many thanks,

 

Sky.

 

Link to comment
Share on other sites

Aha - I think I found the answer...

 

In the php script on my web server I added the following line:

 

$data = str_replace(" ","+",$_POST['data']);

 

so it is now:

 

$data = str_replace(" ","+",$_POST['data']);
$data = base64_decode($data);
file_put_contents('test.png', $data);

 

..where $_POST['data'] is the base64 encoded text generated by FileMaker 13, and also the Base elements plugin....

  • Like 1
Link to comment
Share on other sites

This topic is 2810 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
 Share

×
×
  • Create New...

Important Information

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