AnsweredAssumed Answered

FilemakerServer Advanced 12 Custom Web Publishing Container Images

Question asked by sebman on Jul 13, 2012
Latest reply on Jul 17, 2012 by sebman

Title

FilemakerServer Advanced 12 Custom Web Publishing Container Images

Your post

Hello Fellow FMSA 12 Admins,

I just made a complete new Install of FileMaker Server Advanced 12 onto a newly set up macmini running 10.7.4 using
Filemakers own PHP. I didn't change any php or Database files, but somehow Images comming from container Fields stored 
in the Database are not beeing displayed anymore. I get the following Error Message:

Original Error Message:
Die Grafik "http://www.domain.com/image.php?path=/fmi/xml/cnt/data.jpg?
-db=DATABASE&-lay=Internet&-recid=xxxx&-field=container" konnte nicht angezeigt werden, weil sie Fehler enthält.

Translation:
The Image "...." could not be displayed, because it contains errors.

The Database is accessable via PHP and XML privilages and i checked Usernames and Passwords twice. 
These are the calling Methods:

Image call:
<img src='inc/image.php?path=".urlencode($records[0]->getField('container'));

image.php:
<?php
    require_once ('FileMaker.php');
    $fm = new FileMaker();
    $fm->setProperty('database', 'DATABASE');
    $fm->setProperty('username', 'USERNAME');
    $fm->setProperty('password', 'PASSWORD');

     if (isset($_GET['path'])){
          $url = $_GET['path'];
          $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['path']);
     }
?>

On our old Setup (10.5.8 with Filemaker 11) this worked flawlessly... Can anybody give me a hint what i might be missing?

Greetings from Hamburg
Sebastian

Outcomes