Upload and Download FileMaker files using WordPress

Upload and Download FileMaker files using WordPress

Last week I discovered a need to upload and download native FileMaker files using WordPress. My goal:  Find the easiest way to distribute and install a FileMaker Go file short of using the FileMaker SDK for iOS (that comes later). Here is my FaceBook Live broadcast on this post:

Note: during my FaceBook live demo, the download to the iPad failed because I did not copy the proper link (http://415roma.com/wp-content/uploads/2017/06/DroneEutopiaBeta.fmp12)  from my WordPress site. Lesson learned: test and retest before going live!

One of my current projects is to bring an easy to use solution to the burgeoning commercial drone flight world: CRM, flight planning, quoting, invoicing, flight planning and logging, asset usage and replacement, and more. To that end, we are in the development phase of a new program we call Drone Eutopia, a joint venture to make the best drone management software for certified commercial drone pilots. What – you didn’t know there was such a thing as a certified commercial drone pilot?  Well, it’s true. Since August of last year, drone pilots are required to pass an FAA test (and some other requirements) in order to charge for their work. And just like any other business, there are a lot of things to track.

Back to the story.  There are several ways to upload a FileMaker Go file to an iOS device.  FileMaker offers a handy guide:

There are several ways to transfer a file:

  • transfer files to another iOS app on the same device (see the steps below)

  • transfer files to an app on another iOS device using AirDrop (see the steps below); both devices need to have iOS 7 installed and support AirDrop

  • connect the iOS device to iTunes with a USB cable and transfer files to or from the device (see the steps below)

  • send a FileMaker Pro file via email to your device’s Mail app (on the device, tap the file, then select Open in FileMaker Go from the menu that pops up)

  • host a FileMaker Pro file on a web server (including personal web sharing), connect to it with your device’s Safari app, and select it to transfer it to FileMaker Go

The first four ways are not easy for the average user to master.  We needed something easy, something that would allow the user to click a URL and end  up with the file loaded onto an iPad, so I looked into the last option.

It sounds easy, but the first problem jumped up immediately:  A standard WordPress install does not allow the filetype of .fmp12 to be uploaded:

Probem uploading a FileMaker file to WordPress

A little research showed a way to fix the problem:  Modify the WordPress theme’s functions.php file to allow .fmp12 extension to be uploaded. Sounds simple enough, right?  OK, maybe not so much.

The problem is the functions.php file is buried in a folder in your website.  And messing with that file could cause problems.  If you don’t want to do that yourself, contact your webmaster or someone skilled in that area and have them do it.  The code they need to add to the functions.php file is located further down this post.

Dive In

For those willing to risk it, here are some rough instructions:

You’ll find the functions.php file in themes folder in the wp-content folder in your website folder on your internet server.  Find your installed theme folder and open it.  You’ll find the functions file there.  The path will be similar to this:

public_html > yourwebsitefolder > wp-content > themes > yourthemename > functions.php

When I opened that file on FileMakerProGurus, I saw this:

functions_php warning

DO NOT EDIT THIS FILE!  They sounded serious, so I paid attention. Besides, my website is working fine, so no need to break things by changing a file I shouldn’t or by adding a child theme.  So onto the next idea:  Install a new, basic WordPress website with a spare URL we had laying around, using a basic WordPress theme.

That took a bit of time, but we ended up with a theme with close to six hundred lines of code in the functions.php file. I ignored all of that, and at the very end of the file i added the following code:

Code to add to functions.php file

You can copy and paste the code below.

/**
* allow filemaker .fmp12 uploads”
*/
function my_myme_types($mime_types){
$mime_types[‘fmp12’] = ‘application/x-filemaker’; //Adding fmp12 extension
return $mime_types;
}
add_filter(‘upload_mimes’, ‘my_myme_types’, 1, 1);

 

Save and close, and now you can upload FileMaker files to WordPress:

Upload and Download FileMaker files using WordPress

You can now Upload and Download FileMaker files using WordPress!

To easily share this FileMaker file, simply share the link:  http://415roma.com/wp-content/uploads/2017/05/DroneEutopia.fmp12.  Open Safari on your iPad and enter the link and choose Open in FileMaker Go when prompted.

Caveats

Make sure your file is password protected or encrypted if your data is sensitive or if you need to prevent piracy.  Anyone with the link can download the file.  If your file is over 128mb in size, you may need to change that parameter on your website, too.  Other than that, you are good to go!


There is nothing as stupid as an educated man if you get him off the thing he was educated in.

Will Rogers
US humorist & showman (1879 – 1935)

 

Liked Liked
Need FileMaker Development Help? Or to purchase FileMaker Software?
Contact FM Pro Gurus for help