FileMaker BackBlaze Integration
BackBlaze is a large scale cloud storage platform that currently boasts an impressive 1 billion gigabytes of file data hosted on the cloud and counting. With its competitive pricing, BackBlaze makes a strong case for a place where you can store and retrieve large amounts of data at an affordable rate. Integrating your FileMaker application with BackBlaze’s B2 Cloud Storage API can assist moving external files to the cloud, minimizing file size growth and keeping your FileMaker application lightweight.
What You Need
In addition to owning a BackBlaze account, you will need to create a Bucket on your account page. A Bucket is a location where files can be stored, and you can upload files to the Bucket of your choosing. Following this, you will need to generate an application key with access to this Bucket to perform API calls. Please note that the information will only display once so please make sure to document it.
BackBlaze App Key Info
You will need your application key and associated info you received on the BackBlaze account page to authenticate with the BackBlaze B2 Cloud Storage API. Authenticating successfully gives you an Authentication Token, an API Url, and a Download Url. These credentials are only valid for 24 hours, and after that they must be refreshed. Here is an example of a result:
Using the API Url from the authentication process and its associated credentials, you now need to generate an Upload Url. This Url is used to upload files onto your BackBlaze account. Much like the authentication process, this Url is only valid for 24 hours.
With the Upload Url in hand, you can now push container files from FileMaker into BackBlaze’s cloud storage. Your curl request should look something like this:
"-X POST " & ¶ & "-H \"Authorization: " & $uploadAuthToken & "\"" & ¶ &
"-H \"X-Bz-File-Name: " & $fileNameEncoded & "\"" & ¶ &
"-H \"Content-Type: b2/x-auto" & "\"" & ¶ &
"-H \"X-Bz-Content-Sha1: " & $sha1 & "\"" & ¶ &
"-H \"X-Bz-Info-Author: unknown" & "\"" & ¶ &
A SHA1 Checksum is recommended when uploading your files to BackBlaze. This ensures that the file is not corrupted while in transit between FileMaker and the cloud. You can apply the following FileMaker function to generate a SHA1 checksum on a container.
HexEncode ( CryptDigest ( <
If your file was successfully uploaded, you should receive a response with a status of 200, indicating that your file was successfully uploaded to your bucket on BackBlaze. Additionally, a fileID will be passed alongside the response, which is that file’s unique identifier on your BackBlaze account. You will need this fileID to download that file from BackBlaze.
Additionally, successful uploads should display on your BackBlaze account.
BackBlaze File Display
Using the Download Url from authentication in tandem with the fileID from your upload request, you can perform an API call to request a download of a specific file. In the headers from the response you have access to BackBlaze’s SHA1 checksum as well, so you can compare it against what you have to see if there is any corruption.
Displaying Files In FileMaker
One thing you’ll want to keep in mind when working with the API is that you’ll need to store a representation of all the files as rec