Question

How to upload file to FME Server for processing

  • 6 April 2021
  • 6 replies
  • 87 views

Badge

Like to upload 1:n files through a FME Server App to FME Server for processing (kick off several automations that are triggerd by a directory watch). I have setup a workspace containing a Data File Reader and a File Copy Writer. It works but some unnecessary processing is done. For example zip's are unzipped and I have to filter to get the original zip for copying. Is there a more elegant way to upload files without FME start processing things?

 

Sweco_UploadFileToFMEServer_20210406


6 replies

Badge +2

Hi @michielschram​ ,

 

To be able to upload a file through the FME Server interface you don't actually need to include a Reader, all that is needed is a published parameter of type File. Therefore I think you could replace the Data File Reader>StringSearcher>Sampler with a Creator. Then in the AttributeManager set the output attribute filecopy_source_dataset to the source file published parameter. This should move the file from the temp upload location to the directory you are watching without any unnecessary file processing.

Badge

Hi @hollyatsafe​ ,

Thank you for your answer. Your solution works fine for uploading one file but I can not upload several files. My use case is uploading 1:n files for processing. Is there another solution?

Badge +2

Hi @hollyatsafe​ ,

Thank you for your answer. Your solution works fine for uploading one file but I can not upload several files. My use case is uploading 1:n files for processing. Is there another solution?

Hi @michielschram​ ,

 

Is the overall goal for the end user to upload a zip containing several files and this workspace should unzip and copy each of the files separately into the directory watch to be processed individually, or for the entire zip file to be copied into the directory being watched?

Badge

Hi @hollyatsafe​ 

The overall goal is to upload several files with different extensions but with the same calculation settings. I'm setting up a system to "feed" an api and proces the result. The files contain sources which should be calculated and can be a .gml, .pdf or zipped.

Badge +2

Hi @hollyatsafe​ 

The overall goal is to upload several files with different extensions but with the same calculation settings. I'm setting up a system to "feed" an api and proces the result. The files contain sources which should be calculated and can be a .gml, .pdf or zipped.

Hi @michielschram​ ,

It's not possible to upload multiple files into a single published parameter so I think there are a few alternative options.

 

Option 1

Set up your workspace with multiple File published parameters and make these optional. There would still be a limit on the number of files the user could upload but this could be, say 5, instead of 1.

 

Option 2

Leave the workspace as is and in the app description include a note that the user will need to run the app separately for each file they wish to upload.

 

Option 3

In the app description ask the user to zip up all files they wish to upload for processing and modify the workspace so that it first unzips the file before copying all of the contents into the directory the Automation is watching so a separate event is triggered for each file within the zip.

Badge

Hi @hollyatsafe​ ,

Thank you for the options but I think I like my "Option 0" best. Adding extra actions to work processes do not have my preference. I will put an idea on the board for the file/url parameter to be able to handel more than one item.

Reply