How to download file from container

Is there a native BF technique to download a file from a FileMaker container?

If I am not mistaken you can upload easily via dropzone, but not download container data.

However there are a few work arounds that I have found, virtual folder was the best for my workflow. Heres a link about it:
https://msdev.co.uk/sharing-content-via-the-web-from-filemaker/

Do you have link for the other workarounds you found?

No I do not just some experience. Are you just trying to display container data from FileMaker to you FM BetterForms front-end? Or actually download the container data to your pc using FM BetterForms ?

@delfs This will be a major issue for our next project and I am very keen to avoid additional dependencies on paid for services.

No need for a paid service, if you are downloading, you can simply put the file in a web accessible folder and add the link to your BF page.

1 Like

Options:

1 Like

Charles this doesn’t really help as the result is storing 2 copies of every document.

Have you looked at Steves options then?

Also you can remove the files, as the are really just temp.

I have looked at them. It seems like a lot of unnecessary effort to copy file to a second location for on demand downloading and then delete them again afterwards.

I guess don’t really understand why it is not possible to download directly from the FileMaker Server using XML or Data APIs.

It is pretty confusing what your goal is, but if you set up the virtual folder, downloading the container data from a BF site is simple at that point. You just add the download attribute to some button or image that references the link from the virtual folder:

<a href="YOUR_IMAGE_PATH" download>
  <img src="YOUR_IMAGE_PATH" >
</a>

We’ve been struggling with this and are trying out the following technique - interested in any thoughts/improvements:

https://forum.fmbetterforms.com/t/new-technique-for-file-downloads-using-base64

Steve, thanks for sharing the symlink technique. I was able to use it on MacOS and set up my shared folder in the Documents path. Do you see any potential issues with using this method on a folder within the RC_Data_FMS folder?

Update: FMS V19 ExecuteDAPI script step ( must run as PSOS) will return a url to the container that you can then use to open in a new browser tab. ( Cant use in same tab due to CORS settings FMS has placed in, but may change down road)

Any idea how to get the file to download with the correct filename rather than a really long uuid?

May be able to with a bit of JS ( in new tab due to FMP’s CORs headers)

Ref: greasemonkey - How do I change a filename on-download with javascript? - Stack Overflow

Seems perhaps the effort of my suggestions wasn’t so bad after all, given that 10 months later this problem still seems to be ongoing, and even hackier workarounds are being suggested :wink:

I am researching on something and stumbled across this post. I have a similar need and the way I achieve is is to use file.io (free). User click something on the fmbf’s form (example: fires OnUtility). Business file gets it then isolate the desirable record with the container field. Business file uses insert from URL to send the container up to file.io and retrieve the link. Business file mutates $BF_App with the link in it. Fmbf receives the responses and open a new tab using this link inside BF_App. User clicks to download in this new tab.