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.

Download Container Data via PHP to local Server

Featured Replies

Hi,

we are using a little sync script via php, which allows us to store all data from a FileMaker DB into our internal MySQL-Database. 
The only problem iam unable to solve is how to download images from container fields and store them local on our web server. 

I tried something like:
 

foreach($recordsPersons as $recordPersonsData) {

          //saving images to /srv/www/htdocs/
          $url_orig = urlencode($recordPersonsData->getField('FotoDatei'));

          // Search for the extension of the file 
          $url = substr($url_orig, 0, strpos($url_orig, "?")); 
          $url = substr($url_orig, strrpos($url_orig, ".") + 1); 

          // Send the correct Content-Type header 
          if($url == "jpg"){ 
              header('Content-type: image/jpeg'); 
          } else if($url == "gif"){ 
              header('Content-type: image/gif'); 
          } else{ 
              header('Content-type: application/octet-stream'); 
          } 

          // save file local.
          file_put_contents('/srv/www/htdocs/testfilepicture.jpg', $fm->getContainerData($url_orig));
}

I was using this reference: http://blog.myfmbutler.com/?p=104

This Code-Snipped works well, but only writes "getContainerData() does not support remote containers" into testfilepicture.jpg..

We are using FileMaker Server 14.

Any Ideas?

Thanks in advance and Cheers

Edited by Marcwa19197

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.