Skip to main content

Hello,

I have a trouble with zipfiles.

I made a script that take multiple files and put them into a PostgreSQL database (in a binary column).

My script works really great : I'm using a datafile reader to get files and the PostgreSQL writter put them into my DB without any problems.

Where it doesn't work : when I try to import zip files, FME try to unzip them.

 

I don't want them to be unzipped, I want them to be imported as zip files directly into the DB.

 

Have you any solution ?

 

Thank you for your answer.

Best regards.

Arthur Bazin

No one ever had this trouble or a solution ?

 


Hi @savoierider

I would recommend taking a look at the AttributeFileReader transformer for zip files instead of using the Data File reader.

I tested with a sample zip file and the AttributeFileReader created an attribute containing a value that starts the hexadecimal value 504B0304. This matches with the file signature for .zip files listed on this page: https://en.wikipedia.org/wiki/List_of_file_signatures


Hi @debbiatsafe,

Thanks for your answer but it was only part of the solution. But my question was not complete :-)

After a lot of research, I find how to do what I want :

First, get a Directory and File Pathnames Reader with the option "Single Merged Feature Type".

 

Then using the AttributeFileReader.

Ok, it look really simple and easy but I don't know why, sometimes (on other projects) the Directory and File Pathnames Reader open zip files and lists all files that are in. I think it comes from parameters of the Reader but I can not find exactly witch parameter. But nevermind, it works and that's the goal...

Thank's


Reply