Question

How to read all shapefiles in a ZIP file regardless of how deep the directory structure

  • 22 March 2023
  • 2 replies
  • 10 views

Badge +2

I would like to POST a zip file to a workspace in FME Server and read the shapefiles from it. The problem is that the shapefiles could be multiple directories deep. In workbench, I can use [**\\*.shp] as indicated here, but this is not retained on the FeatureReader dataset path when the zipfile is posted to the data streaming service in FME Server. Is there a way to achieve this?


2 replies

Userlevel 5
Badge +29

When you POST (upload) the zip file to FME Server, it has no reference or knowledge of where that file existed on the machine that supplied it. It's impossible for it to know the directory where that file came from.

 

The flow actually gets split into two "sub" tasks.

  1. The file is uploaded to FME Server and stored in its temp directory
  2. The path of the uploaded file in the temp directory is then passed to the process on FME server.

As far as the workbench is concerned, the file originates from the server itself, not the client requesting the process to run

Badge +2

When you POST (upload) the zip file to FME Server, it has no reference or knowledge of where that file existed on the machine that supplied it. It's impossible for it to know the directory where that file came from.

 

The flow actually gets split into two "sub" tasks.

  1. The file is uploaded to FME Server and stored in its temp directory
  2. The path of the uploaded file in the temp directory is then passed to the process on FME server.

As far as the workbench is concerned, the file originates from the server itself, not the client requesting the process to run

I am aware of this, but I was hoping there was maybe some setting I missed that would allow me do to this more easily.

 

I have now updated my process to do the upload first, then make the request to the workspace with a published parameter that is used to set the file path. A FeatureReader with the dataset value set to the published parameter with [**\\*.shp] appended to the string reads all of the shapefiles regardless of the directory structure inside the zipfile.

Reply