FileMaker 11 CWP Get Container method Question

Discussion created by on Dec 14, 2015
Latest reply on Dec 14, 2015 by

This question may be a duplicate but I have been unable to locate a suitable answer. First let me provide some context of what I am attempting to do with these images. Each customer has a personalized splash screen image. My goal is download image and display, on the web site, their own splash screen image. 


So given the context above, I uploaded, to a FileMaker 11 database, a image named berry.png to a FileMaker layout. If I right click the image in the layout for download it saves berry.png to disk. When I connect to the database using PHP API, get the URL from container field, and then execute the getContainer method using the URL from the field it always saved as a JPEG file. My code, below, is very simple.



$DB_HOST = '';
$DB_NAME = 'database';
$DB_USER = 'username';
$DB_PASS = 'password';

$fm = new FileMaker($DB_NAME, $DB_HOST, $DB_USER, $DB_PASS);

$layout = "images_display";
$documentTitle = "Berry";

$search = $fm->newFindCommand($layout);
$search->addFindCriterion("image_name", "==" .$documentTitle);
$result = $search->execute();

$record = $result->getFirstRecord();
$imageUrl = $record->getField("image_field");

echo "Image URL: " .$imageUrl ."</br>";

$rawImage = $blogDB->getContainerData($imageUrl);

When I echo the URL I get an Image URL: /fmi/xml/cnt/data.jpg?-db=Blog&-lay=images_display&-recid=4&-field=image_field(1). When I query the image using the PHP getimagesize() method the mime type it returns is 'image/jpeg' which is expected given the URL. If this question is a duplicate question then please point me to the URL of the discussion or post. If there is a configuration that I have failed to setup then please let me know.