Solved

Read Features from .zip or .tar.gz

  • 23 July 2017
  • 5 replies
  • 14 views

Badge

Hi,

My customers upload .zip or .tar.gz files to our server, I have a CSV reader, when I set the url (https://mydomain.com/customer1.zip) of a zip file with only 1 file, FME server works fine.

Now, a customer send us .tar.gz files with several files in it, for this spacific workspace I need to grab only one file form the package, there is a way to specify which will be the file in the url to process? I tried with https://mydomain.com/customer2.tar.gz\\students.txt with no luck, I manually convert to a zip file https://mydomain.com/customer2.zip\\students.txt but nothing works.

Thanks

VictorV

icon

Best answer by pallegama 27 July 2017, 07:31

View original

5 replies

Userlevel 1
Badge +18

Hi Victor you should use a slash instead of a ". "

https://mydomain.com/customer2.tar/gzstudents.txt

Badge

Hi Victor you should use a slash instead of a ". "

https://mydomain.com/customer2.tar/gzstudents.txt

Hi I use https://mydomain.com/customer2.tar.gz/students.txt for gzip and https://mydomain.com/customer2.zip/students.txt for the zip file a none of them works. I receive the error: 

 

 

CSV reader: Failed to open file 'https://mydomain.com/customer2.tar.gz/students.txt' for reading. Please ensure that the file exists and you have sufficient privileges to read it

 

I verified and the zip/tar.gz file has students.txt inside.

 

 

Userlevel 1
Badge +18
Hi I use https://mydomain.com/customer2.tar.gz/students.txt for gzip and https://mydomain.com/customer2.zip/students.txt for the zip file a none of them works. I receive the error: 

 

 

CSV reader: Failed to open file 'https://mydomain.com/customer2.tar.gz/students.txt' for reading. Please ensure that the file exists and you have sufficient privileges to read it

 

I verified and the zip/tar.gz file has students.txt inside.

 

 

Do you run it from FME Server?

 

 

You can use the HTTPCaller to download the file locally and then use a FeatureReader to read it.

 

 

Badge
Do you run it from FME Server?

 

 

You can use the HTTPCaller to download the file locally and then use a FeatureReader to read it.

 

 

 

Hi,

 

 

I Would Like to use the same parameter for the reader to load locally, temporary upload or a remote file.
Badge

Hi @velasquezvictor,

I agree with @stalknecht of using HTTPCaller in this case. Since you are looking for using same parameter for local and remote files, you can use a workflow as depicted in the attached workspace template.

zipfile-reader.fmwt

In this workflow, source file path (local or remote) should be passed through 'Source' Published Parameter and the first Tester identifies and divert remote paths to download the zip/gz file before passing it to FeatureReader. This workspace works on both FME Desktop and FME Server.

Alternatively, you can think of writing a Startup Python script to do this.

Regards, Priyantha Pallegama

Reply