Solved

Placing a link on a webpage to download data

  • 29 February 2024
  • 4 replies
  • 123 views

Badge +4

Hey everyone,

 

On FME Server (2021.2.6) I have resources that I want to make available on an HTML page. I want users to be able click on the link and immediately download the data that's in the resource folder: https://fmeserver.EXAMPLE.com/fmeserver/#/resources/browse/FME_SHAREDRESOURCE_DATA/EXAMPLE?name=Data

 

Seems like a pretty standard deal.

icon

Best answer by timatsafe 4 March 2024, 22:41

View original

4 replies

Userlevel 1
Badge +3

Hi @bkgg,

You can do this by creating a workspace to retrieve the data from the FME Server Resources by using the FMEServerResourceConnector transformer or by calling the FME Server REST API using the HTTPCaller transformer. After you’ve created the workspace you can publish it to FME Server and create a workspace app that can be shared as a URL to users or by generating a webhook URL (see Run or Share a Workspace>Other Ways to Run this Workspace>Webhook URL).

 

Badge +4

Thanks Tim. This ought to do the trick.

Badge +13

When I think of publishing such a workspace as webhook, what do you enter as Download to Folder parameter? I want to download a geopackage file to the default Windows Downloads directory on client machines that issued the download link in their web browser.

And is it sufficient to only use the FlowRecourceConnector to initialize the download, or do I have to read the file in my workspace afterwards and rewrite it so it can be downloaded?

Userlevel 3
Badge +5

Hi @bkgg,

You can do this by creating a workspace to retrieve the data from the FME Server Resources by using the FMEServerResourceConnector transformer or by calling the FME Server REST API using the HTTPCaller transformer. After you’ve created the workspace you can publish it to FME Server and create a workspace app that can be shared as a URL to users or by generating a webhook URL (see Run or Share a Workspace>Other Ways to Run this Workspace>Webhook URL).

 

just to say i dont think you need to create the workspace app. In he “run worskspace” just make sure the service is set to a “data download service” and create a webhook from there in the advanced section.

Reply