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.

Display image from database

Featured Replies

  • Newbies

Hi, i have php api installed on a seperate web server from the filemaker pro database server.

For example web server address 160.169.82.9, filemaker pro database server 160.169.82.10

I have the following script on web server called img.php

<?php

require_once("FileMaker.php");

$databaseName = 'test';

$userName = 'test';

$passWord = 'test';

$serverAddress = '160.169.82.10';

$fm = & new FileMaker();

$fm->setProperty('database',$databaseName);

$fm->setProperty('hostspec', $serverAddress);

$fm->setProperty('username',$userName);

$fm->setProperty('password',$passWord);

if (isset($_GET['-url']))

{

$url = $_GET['-url'];

$url = substr($url, 0, strpos($url, "?"));

$url = substr($url, strrpos($url, ".") + 1);

if($url == "jpg"){

header('Content-type: image/jpeg');

}

else if($url == "gif"){

header('Content-type: image/gif');

}

else{

header('Content-type: application/octet-stream');

}

echo $fm->getContainerData($_GET['-url']);

}

?>

Then i visit:

http://160.169.82.9/img.php?-url=%2Ffmi%2Fxml%2Fcnt%2Fdata.jpg%3F-db%3DAppel%2520Tradecards.fp7%26amp%3B-lay%3DData%2520Entry%26amp%3B-recid%3D2184%26amp%3B-field%3DImage%2520web%281%29

*** The read text is a valid url point to the image in the database(I hard coded for testing purpose)

It doesn't show the image from database, and no error code as well.

But, if i put the exactly same script on to filemaker pro server(which also have ISS installed), then it shows up the image from the database.

From my thought, i think the function getContainerData() doesn't work on the web server(separate from the FM server), and it works if the script hosted on the same machine as FM server. I do have FileMaker.php and FileMaker api folder on web server, i'm pretty sure this script connected to FM serve database successfully, since i can fetch out other text data from the database(just not image). Do i still missing any plugins on web server?

Create an account or sign in to comment

Important Information

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

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.