Skip to main content
Question

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


cnieman
Contributor
Forum|alt.badge.img+6

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

hkingsbury
Celebrity
Forum|alt.badge.img+53
  • Celebrity
  • March 22, 2023

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


cnieman
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • March 23, 2023
hkingsbury wrote:

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.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings